initiate
This commit is contained in:
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键事项明细
|
||||
/// </summary>
|
||||
public static class GJSXItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据关键事项ID查询所有关键事项进展
|
||||
/// </summary>
|
||||
/// <param name="GJSXID">关键事项ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.GJSX_detail> GetGJSXDetailByGJSXID(string GJSXID)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_detail where x.GJSXID == GJSXID orderby x.Sort select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据关键事项ID查询所有事项进展
|
||||
/// </summary>
|
||||
/// <param name="guid">关键事项ID</param>
|
||||
/// <returns></returns>
|
||||
public static System.Collections.IEnumerable GetIEnumerableByGJSXID(string GJSXID)
|
||||
{
|
||||
return from x in db.GJSX_detail
|
||||
where x.GJSXID == GJSXID
|
||||
orderby x.Sort
|
||||
select new
|
||||
{
|
||||
x.Cuid,
|
||||
x.GJSXID,
|
||||
x.Progress_user,
|
||||
x.Date,
|
||||
x.Progress_detail,
|
||||
x.FilePath
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加关键事项明细
|
||||
/// </summary>
|
||||
/// <param name="gjsxmx"></param>
|
||||
public static void AddGJSXMX(Model.GJSX_detail gjsxmx)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.GJSX_detail));
|
||||
Model.GJSX_detail newGJSXMX = new Model.GJSX_detail();
|
||||
|
||||
newGJSXMX.Cuid = newKeyID;
|
||||
newGJSXMX.GJSXID = gjsxmx.GJSXID;
|
||||
newGJSXMX.Progress_user = gjsxmx.Progress_user;
|
||||
newGJSXMX.Progress_detail = gjsxmx.Progress_detail;
|
||||
newGJSXMX.Date = gjsxmx.Date;
|
||||
newGJSXMX.Sort = gjsxmx.Sort;
|
||||
newGJSXMX.FilePath = gjsxmx.FilePath;
|
||||
|
||||
db.GJSX_detail.InsertOnSubmit(newGJSXMX);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据关键事项Id删除所对应的所有事项进展
|
||||
/// </summary>
|
||||
/// <param name="GJSXID">关键事项ID</param>
|
||||
public static void DeleteGJSXMXByGJSXID(string GJSXID)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.GJSX_detail where x.GJSXID == GJSXID select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.GJSX_detail.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加操作人员
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public static void AddItemUser(Model.GJSX_detail item)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX_detail newitem = new Model.GJSX_detail();
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.GJSX_detail));
|
||||
newitem.Cuid = newKeyID;
|
||||
newitem.GJSXID = item.GJSXID;
|
||||
newitem.Progress_user = item.Progress_user;
|
||||
newitem.Sort = item.Sort;
|
||||
newitem.FilePath = item.FilePath;
|
||||
newitem.Progress_detail = item.Progress_detail;
|
||||
db.GJSX_detail.InsertOnSubmit(newitem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
public static void UpdateGJSXdetail(Model.GJSX_detail _GJSX_detail)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX_detail newGJSX_detail = db.GJSX_detail.FirstOrDefault(e => e.Cuid == _GJSX_detail.Cuid);
|
||||
if (newGJSX_detail != null)
|
||||
{
|
||||
newGJSX_detail.Cuid = _GJSX_detail.Cuid;
|
||||
newGJSX_detail.GJSXID = _GJSX_detail.GJSXID;
|
||||
newGJSX_detail.Progress_user = _GJSX_detail.Progress_user;
|
||||
newGJSX_detail.Progress_detail = _GJSX_detail.Progress_detail;
|
||||
newGJSX_detail.Sort = _GJSX_detail.Sort;
|
||||
newGJSX_detail.FilePath = _GJSX_detail.FilePath;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据关键事项编号获取关键事项进展信息
|
||||
/// </summary>
|
||||
/// <param name="GJSXID"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.GJSX_detail GetGJSXItemByGJSXID(string GJSXID)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_detail where x.GJSXID == GJSXID select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static Model.GJSX_detail GetGJSXItemByGJSXID(string GJSXID,string userid)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_detail where x.GJSXID == GJSXID && x.Progress_user==userid select x).FirstOrDefault();
|
||||
}
|
||||
|
||||
#region 删除外键引用
|
||||
/// <summary>
|
||||
/// 根据事项进展操作人获取事项进展信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetGJSXMXByUserId(string userId)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_detail where x.Progress_user == userId select x).Count();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 关键事项明细是否存在该用户
|
||||
/// </summary>
|
||||
/// <param name="GJSXID"></param>
|
||||
/// <param name="operationId"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistOperateionId(string GJSXID, string operationId)
|
||||
{
|
||||
var q = from x in db.GJSX_detail where x.GJSXID == GJSXID && x.Progress_user == operationId select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据编号和负责人获取明细数量
|
||||
/// </summary>
|
||||
/// <param name="GJSXID"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetGJSXMXByGJSXIDAndUserId(string GJSXID, string userId)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_detail where x.GJSXID == GJSXID && x.Progress_user == userId select x).Count();
|
||||
}
|
||||
|
||||
public static Model.GJSX_detail GetGJSXMXById(string id)
|
||||
{
|
||||
return Funs.DB.GJSX_detail.FirstOrDefault(e => e.Cuid == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class GJSXProcessService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="process"></param>
|
||||
public static void AddProcess(Model.GJSX_Process process)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX_Process newProcess = new Model.GJSX_Process();
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.GJSX_Process));
|
||||
newProcess.ProcessID = newKeyID;
|
||||
newProcess.UserId = process.UserId;
|
||||
newProcess.GJSXID = process.GJSXID;
|
||||
|
||||
db.GJSX_Process.InsertOnSubmit(newProcess);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="GJSXID"></param>
|
||||
public static void DeleteProcess(string GJSXID)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.GJSX_Process where x.GJSXID == GJSXID select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.GJSX_Process.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据事项进展操作人获取事项进展信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetGJSXProcessByUserId(string userId)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_Process where x.UserId == userId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据事项进展操作人获取事项进展信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetGJSXProcessByGJSXIDAndUserId(string GJSXID, string userId)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_Process where x.GJSXID == GJSXID && x.UserId == userId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据编号获取下一接收人信息
|
||||
/// </summary>
|
||||
/// <param name="GJSXID"></param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetProcessListByGJSXID(string GJSXID)
|
||||
{
|
||||
return (from x in Funs.DB.GJSX_Process where x.GJSXID == GJSXID select x.UserId).Distinct().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class GJSXService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.GJSX GetGJSXById(string _GJSXID)
|
||||
{
|
||||
return Funs.DB.GJSX.FirstOrDefault(e => e.GJSXID == _GJSXID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="?"></param>
|
||||
public static void AddGJSX(Model.GJSX _GJSX)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX newGJSX = new Model.GJSX
|
||||
{
|
||||
GJSXID = _GJSX.GJSXID,
|
||||
Detail = _GJSX.Detail,
|
||||
UserID = _GJSX.UserID,
|
||||
CreateDate = _GJSX.CreateDate,
|
||||
User_ReceiveID = _GJSX.User_ReceiveID,
|
||||
CNProfessional_ID = _GJSX.CNProfessional_ID,
|
||||
ProjectId = _GJSX.ProjectId,
|
||||
UnitId = _GJSX.UnitId,
|
||||
CloseDate = _GJSX.CloseDate,
|
||||
State = _GJSX.State,
|
||||
QuestionTypeID = _GJSX.QuestionTypeID,
|
||||
IsManypeople = _GJSX.IsManypeople,
|
||||
CompleteDate = _GJSX.CompleteDate,
|
||||
AttachUrl = _GJSX.AttachUrl,
|
||||
User_Acceptance = _GJSX.User_Acceptance
|
||||
};
|
||||
|
||||
db.GJSX.InsertOnSubmit(newGJSX);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="teamGroup"></param>
|
||||
public static void UpdateGJSX(Model.GJSX _GJSX)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX newGJSX = db.GJSX.FirstOrDefault(e => e.GJSXID == _GJSX.GJSXID);
|
||||
if (newGJSX != null)
|
||||
{
|
||||
newGJSX.GJSXID = _GJSX.GJSXID;
|
||||
newGJSX.Detail = _GJSX.Detail;
|
||||
newGJSX.UserID = _GJSX.UserID;
|
||||
newGJSX.CreateDate = _GJSX.CreateDate;
|
||||
newGJSX.User_ReceiveID = _GJSX.User_ReceiveID;
|
||||
newGJSX.CNProfessional_ID = _GJSX.CNProfessional_ID;
|
||||
newGJSX.ProjectId = _GJSX.ProjectId;
|
||||
newGJSX.UnitId = _GJSX.UnitId;
|
||||
newGJSX.CloseDate = _GJSX.CloseDate;
|
||||
newGJSX.State = _GJSX.State;
|
||||
newGJSX.QuestionTypeID = _GJSX.QuestionTypeID;
|
||||
newGJSX.IsManypeople = _GJSX.IsManypeople;
|
||||
newGJSX.CompleteDate = _GJSX.CompleteDate;
|
||||
newGJSX.AttachUrl = _GJSX.AttachUrl;
|
||||
newGJSX.User_Acceptance = _GJSX.User_Acceptance;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="_GJSXID"></param>
|
||||
public static void DeleteGJSXById(string _GJSXID)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.GJSX _GJSX = db.GJSX.FirstOrDefault(e => e.GJSXID == _GJSXID);
|
||||
{
|
||||
db.GJSX.DeleteOnSubmit(_GJSX);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
private static int count;
|
||||
|
||||
public static System.Collections.IEnumerable GetListData(string projectId)
|
||||
{
|
||||
IQueryable<Model.GJSX> q =GetGJSXList().AsQueryable();
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
|
||||
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return new object[] { "" };
|
||||
}
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.GJSXID,
|
||||
x.Detail,
|
||||
tcr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(),
|
||||
x.CreateDate,
|
||||
zrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(),
|
||||
regipient = x.GJSXID,
|
||||
qrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(),
|
||||
sjqrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(),
|
||||
x.CNProfessional_ID,
|
||||
AffprojectId = (from y in db.Base_Project where y.ProjectId == x.ProjectId select y.ProjectName).First(),
|
||||
unit = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
|
||||
x.CloseDate,
|
||||
x.State,
|
||||
x.QuestionTypeID,
|
||||
x.CompleteDate,
|
||||
x.AttachUrl,
|
||||
x.User_Acceptance
|
||||
//Acceptance = (from y in db.Sys_User where y.UserId == x.Acceptance select y.UserName).FirstOrDefault()
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取问题下拉项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.GJSX> GetGJSXList()
|
||||
{
|
||||
var list = (from x in Funs.DB.GJSX orderby x.QuestionTypeID select x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitQuestionTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "GJSXID";
|
||||
dropName.DataTextField = "QuestionTypeName";
|
||||
dropName.DataSource = GetGJSXList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
//public static Model.GJSX GetQuestionTypeByName(string name)
|
||||
//{
|
||||
// return Funs.DB.GJSX.FirstOrDefault(e => e.QuestionTypeName == name);
|
||||
//}
|
||||
///// <summary>
|
||||
///// 根据工程类别获取专项方案类别下拉项
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public static List<Model.GJSX> GetQuestionTypeByTempleteList(string ProjectId)
|
||||
//{
|
||||
// var list = (from x in Funs.DB.GJSX where x.ProjectId == ProjectId orderby x.QuestionTypeCode select x).ToList();
|
||||
// return list;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 类型表下拉框
|
||||
///// </summary>
|
||||
///// <param name="dropName">下拉框名字</param>
|
||||
///// <param name="isShowPlease">是否显示请选择</param>
|
||||
//public static void InitQuestionTypeByTempleteDropDownList(FineUIPro.DropDownList dropName, string ProjectId, bool isShowPlease)
|
||||
//{
|
||||
// dropName.DataValueField = "GJSXID";
|
||||
// dropName.DataTextField = "QuestionTypeName";
|
||||
// dropName.DataSource = GetQuestionTypeByTempleteList(ProjectId);
|
||||
// dropName.DataBind();
|
||||
// if (isShowPlease)
|
||||
// {
|
||||
// Funs.FineUIPleaseSelect(dropName);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user