20210430
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);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目级施工日志
|
||||
/// </summary>
|
||||
public static class ConstructionLogService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ConstructionLog GetConstructionLogById(string ConstructionLogId)
|
||||
{
|
||||
return Funs.DB.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId == ConstructionLogId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目、用户及日期获取项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ConstructionLog GetConstructionLogByProjectIdAndUserIDAndDate(string constructionLogId, string projectId, string userId, DateTime date)
|
||||
{
|
||||
return Funs.DB.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId != constructionLogId && e.ProjectId == projectId && e.CompileMan == userId);
|
||||
//return Funs.DB.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId != constructionLogId && e.ProjectId == projectId && e.CompileMan == userId && e.CompileDate == date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLog"></param>
|
||||
public static void AddConstructionLog(Model.ZHGL_ConstructionLog ConstructionLog)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLog newConstructionLog = new Model.ZHGL_ConstructionLog
|
||||
{
|
||||
ConstructionLogId = ConstructionLog.ConstructionLogId,
|
||||
ProjectId = ConstructionLog.ProjectId,
|
||||
Weather = ConstructionLog.Weather,
|
||||
TemperatureMax = ConstructionLog.TemperatureMax,
|
||||
TemperatureMin = ConstructionLog.TemperatureMin,
|
||||
MainWork = ConstructionLog.MainWork,
|
||||
MainProblems = ConstructionLog.MainProblems,
|
||||
Remark = ConstructionLog.Remark,
|
||||
CompileMan = ConstructionLog.CompileMan,
|
||||
CompileDate = ConstructionLog.CompileDate,
|
||||
};
|
||||
db.ZHGL_ConstructionLog.InsertOnSubmit(newConstructionLog);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLog"></param>
|
||||
public static void UpdateConstructionLog(Model.ZHGL_ConstructionLog ConstructionLog)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLog newConstructionLog = db.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId == ConstructionLog.ConstructionLogId);
|
||||
if (newConstructionLog != null)
|
||||
{
|
||||
newConstructionLog.Weather = ConstructionLog.Weather;
|
||||
newConstructionLog.TemperatureMax = ConstructionLog.TemperatureMax;
|
||||
newConstructionLog.TemperatureMin = ConstructionLog.TemperatureMin;
|
||||
newConstructionLog.MainWork = ConstructionLog.MainWork;
|
||||
newConstructionLog.MainProblems = ConstructionLog.MainProblems;
|
||||
newConstructionLog.Remark = ConstructionLog.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId"></param>
|
||||
public static void DeleteConstructionLogById(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLog ConstructionLog = db.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId == ConstructionLogId);
|
||||
if (ConstructionLog != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ConstructionLog.ConstructionLogId);
|
||||
db.ZHGL_ConstructionLog.DeleteOnSubmit(ConstructionLog);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取天气状况
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetWeatherList()
|
||||
{
|
||||
ListItem[] lis = new ListItem[4];
|
||||
lis[0] = new ListItem("阴", "阴");
|
||||
lis[1] = new ListItem("晴", "晴");
|
||||
lis[2] = new ListItem("雨", "雨");
|
||||
lis[3] = new ListItem("雪", "雪");
|
||||
return lis;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionPlanApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string ConstructionPlanId)
|
||||
{
|
||||
return from x in db.ZHGL_ConstructionPlanApprove
|
||||
where x.ConstructionPlanId == ConstructionPlanId && x.ApproveDate != null
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructionPlanApproveId,
|
||||
x.ConstructionPlanId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据总承包商施工计划主键删除对应的所有总承包商施工计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">总承包商施工计划主键</param>
|
||||
public static void DeleteConstructionPlanApproveByConstructionPlanId(string noticeId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var data = (from x in db.ZHGL_ConstructionPlanApprove where x.ConstructionPlanId == noticeId select x).ToList();
|
||||
if (data != null)
|
||||
{
|
||||
db.ZHGL_ConstructionPlanApprove.DeleteAllOnSubmit(data);
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加总承包商施工计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlanApprove">总承包商施工计划审批实体</param>
|
||||
public static void AddConstructionPlanApprove(Model.ZHGL_ConstructionPlanApprove ConstructionPlanApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionPlanApprove));
|
||||
Model.ZHGL_ConstructionPlanApprove newConstructionPlanApprove = new Model.ZHGL_ConstructionPlanApprove();
|
||||
newConstructionPlanApprove.ConstructionPlanApproveId = newKeyID;
|
||||
newConstructionPlanApprove.ConstructionPlanId = ConstructionPlanApprove.ConstructionPlanId;
|
||||
newConstructionPlanApprove.ApproveMan = ConstructionPlanApprove.ApproveMan;
|
||||
newConstructionPlanApprove.ApproveDate = ConstructionPlanApprove.ApproveDate;
|
||||
newConstructionPlanApprove.ApproveIdea = ConstructionPlanApprove.ApproveIdea;
|
||||
newConstructionPlanApprove.IsAgree = ConstructionPlanApprove.IsAgree;
|
||||
newConstructionPlanApprove.ApproveType = ConstructionPlanApprove.ApproveType;
|
||||
|
||||
db.ZHGL_ConstructionPlanApprove.InsertOnSubmit(newConstructionPlanApprove);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
public static string AddConstructionPlanApproveForApi(Model.ZHGL_ConstructionPlanApprove ConstructionPlanApprove)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionPlanApprove));
|
||||
Model.ZHGL_ConstructionPlanApprove newConstructionPlanApprove = new Model.ZHGL_ConstructionPlanApprove();
|
||||
newConstructionPlanApprove.ConstructionPlanApproveId = newKeyID;
|
||||
newConstructionPlanApprove.ConstructionPlanId = ConstructionPlanApprove.ConstructionPlanId;
|
||||
newConstructionPlanApprove.ApproveMan = ConstructionPlanApprove.ApproveMan;
|
||||
newConstructionPlanApprove.ApproveDate = ConstructionPlanApprove.ApproveDate;
|
||||
newConstructionPlanApprove.ApproveIdea = ConstructionPlanApprove.ApproveIdea;
|
||||
newConstructionPlanApprove.IsAgree = ConstructionPlanApprove.IsAgree;
|
||||
newConstructionPlanApprove.ApproveType = ConstructionPlanApprove.ApproveType;
|
||||
|
||||
db.ZHGL_ConstructionPlanApprove.InsertOnSubmit(newConstructionPlanApprove);
|
||||
db.SubmitChanges();
|
||||
return newKeyID;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据总承包商施工计划Id获取一个总承包商施工计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">总承包商施工计划Id</param>
|
||||
/// <returns>一个总承包商施工计划审批实体</returns>
|
||||
public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveByConstructionPlanId(string constructionPlanId)
|
||||
{
|
||||
return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == constructionPlanId && x.ApproveDate == null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改总承包商施工计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlanApprove">总承包商施工计划审批实体</param>
|
||||
public static void UpdateConstructionPlanApprove(Model.ZHGL_ConstructionPlanApprove ConstructionPlanApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionPlanApprove newConstructionPlanApprove = db.ZHGL_ConstructionPlanApprove.First(e => e.ConstructionPlanApproveId == ConstructionPlanApprove.ConstructionPlanApproveId);
|
||||
newConstructionPlanApprove.ConstructionPlanId = ConstructionPlanApprove.ConstructionPlanId;
|
||||
newConstructionPlanApprove.ApproveMan = ConstructionPlanApprove.ApproveMan;
|
||||
newConstructionPlanApprove.ApproveDate = ConstructionPlanApprove.ApproveDate;
|
||||
newConstructionPlanApprove.ApproveIdea = ConstructionPlanApprove.ApproveIdea;
|
||||
newConstructionPlanApprove.IsAgree = ConstructionPlanApprove.IsAgree;
|
||||
newConstructionPlanApprove.ApproveType = ConstructionPlanApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static Model.ZHGL_ConstructionPlanApprove GetComplie(string ConstructionPlanId)
|
||||
{
|
||||
return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == ConstructionPlanId && x.ApproveType == BLL.Const.ConstructionPlan_Compile);
|
||||
}
|
||||
public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveById(string ConstructionPlanApproveId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanApproveId == ConstructionPlanApproveId);
|
||||
}
|
||||
}
|
||||
public static List<Model.ZHGL_ConstructionPlanApprove> getListDataByIdForApi(string ConstructionPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.ZHGL_ConstructionPlanApprove
|
||||
where x.ConstructionPlanId == ConstructionPlanId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructionPlanApproveId,
|
||||
x.ConstructionPlanId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
|
||||
};
|
||||
List<Model.ZHGL_ConstructionPlanApprove> res = new List<Model.ZHGL_ConstructionPlanApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.ZHGL_ConstructionPlanApprove wc = new Model.ZHGL_ConstructionPlanApprove();
|
||||
wc.ConstructionPlanApproveId = item.ConstructionPlanApproveId;
|
||||
wc.ConstructionPlanId = item.ConstructionPlanId;
|
||||
wc.ApproveMan = item.ApproveMan;
|
||||
wc.ApproveDate = item.ApproveDate;
|
||||
wc.ApproveIdea = item.ApproveIdea;
|
||||
wc.IsAgree = item.IsAgree;
|
||||
wc.ApproveType = item.ApproveType;
|
||||
wc.ApproveMan = item.UserName;
|
||||
|
||||
res.Add(wc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.ZHGL_ConstructionPlanApprove getCurrApproveForApi(string id)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ZHGL_ConstructionPlanApprove newConstructionPlanApprove = db.ZHGL_ConstructionPlanApprove.FirstOrDefault(e => e.ConstructionPlanId == id && e.ApproveDate == null);
|
||||
if (newConstructionPlanApprove != null)
|
||||
{
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newConstructionPlanApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
newConstructionPlanApprove.ApproveIdea = user.UserName;
|
||||
}
|
||||
}
|
||||
return newConstructionPlanApprove;
|
||||
}
|
||||
} /// <summary>
|
||||
/// 修改总承包商施工计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlanApprove">总承包商施工计划审批实体</param>
|
||||
public static void UpdateConstructionPlanApproveForApi(Model.ZHGL_ConstructionPlanApprove ConstructionPlanApprove)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
Model.ZHGL_ConstructionPlanApprove newConstructionPlanApprove = db.ZHGL_ConstructionPlanApprove.FirstOrDefault(e => e.ConstructionPlanApproveId == ConstructionPlanApprove.ConstructionPlanApproveId);
|
||||
if (newConstructionPlanApprove != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ConstructionPlanApprove.ConstructionPlanId))
|
||||
newConstructionPlanApprove.ConstructionPlanId = ConstructionPlanApprove.ConstructionPlanId;
|
||||
if (!string.IsNullOrEmpty(ConstructionPlanApprove.ApproveMan))
|
||||
newConstructionPlanApprove.ApproveMan = ConstructionPlanApprove.ApproveMan;
|
||||
if (ConstructionPlanApprove.ApproveDate.HasValue)
|
||||
newConstructionPlanApprove.ApproveDate = ConstructionPlanApprove.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(ConstructionPlanApprove.ApproveIdea))
|
||||
newConstructionPlanApprove.ApproveIdea = ConstructionPlanApprove.ApproveIdea;
|
||||
if (ConstructionPlanApprove.IsAgree.HasValue)
|
||||
newConstructionPlanApprove.IsAgree = ConstructionPlanApprove.IsAgree;
|
||||
if (!string.IsNullOrEmpty(ConstructionPlanApprove.ApproveType))
|
||||
newConstructionPlanApprove.ApproveType = ConstructionPlanApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 总承包商施工计划
|
||||
/// </summary>
|
||||
public static class ConstructionPlanService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取总承包商施工计划
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ConstructionPlan GetConstructionPlanById(string ConstructionPlanId)
|
||||
{
|
||||
return Funs.DB.ZHGL_ConstructionPlan.FirstOrDefault(e => e.ConstructionPlanId == ConstructionPlanId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加总承包商施工计划
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlan"></param>
|
||||
public static void AddConstructionPlan(Model.ZHGL_ConstructionPlan ConstructionPlan)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionPlan newConstructionPlan = new Model.ZHGL_ConstructionPlan
|
||||
{
|
||||
ConstructionPlanId = ConstructionPlan.ConstructionPlanId,
|
||||
ProjectId = ConstructionPlan.ProjectId,
|
||||
Code = ConstructionPlan.Code,
|
||||
Content = ConstructionPlan.Content,
|
||||
CompileMan = ConstructionPlan.CompileMan,
|
||||
CompileDate = ConstructionPlan.CompileDate,
|
||||
State = ConstructionPlan.State,
|
||||
};
|
||||
db.ZHGL_ConstructionPlan.InsertOnSubmit(newConstructionPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改总承包商施工计划
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlan"></param>
|
||||
public static void UpdateConstructionPlan(Model.ZHGL_ConstructionPlan ConstructionPlan)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionPlan newConstructionPlan = db.ZHGL_ConstructionPlan.FirstOrDefault(e => e.ConstructionPlanId == ConstructionPlan.ConstructionPlanId);
|
||||
if (newConstructionPlan != null)
|
||||
{
|
||||
newConstructionPlan.Code = ConstructionPlan.Code;
|
||||
newConstructionPlan.Content = ConstructionPlan.Content;
|
||||
newConstructionPlan.State = ConstructionPlan.State;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除总承包商施工计划
|
||||
/// </summary>
|
||||
/// <param name="ConstructionPlanId"></param>
|
||||
public static void DeleteConstructionPlanById(string ConstructionPlanId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionPlan ConstructionPlan = db.ZHGL_ConstructionPlan.FirstOrDefault(e => e.ConstructionPlanId == ConstructionPlanId);
|
||||
if (ConstructionPlan != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ConstructionPlan.ConstructionPlanId);
|
||||
db.ZHGL_ConstructionPlan.DeleteOnSubmit(ConstructionPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.ConstructionPlan_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionPlan_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionPlan_Audit1)
|
||||
{
|
||||
return "施工经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionPlan_Audit2)
|
||||
{
|
||||
return "施工管理部审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionPlan_Audit3)
|
||||
{
|
||||
return "项目经理批准";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionPlan_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
//<summary>
|
||||
//获取办理人姓名
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
public static string ConvertMan(object ConstructionPlanId)
|
||||
{
|
||||
if (ConstructionPlanId != null)
|
||||
{
|
||||
Model.ZHGL_ConstructionPlanApprove a = ConstructionPlanApproveService.GetConstructionPlanApproveByConstructionPlanId(ConstructionPlanId.ToString());
|
||||
if (a != null)
|
||||
{
|
||||
if (a.ApproveMan != null)
|
||||
{
|
||||
return UserService.GetUserByUserId(a.ApproveMan).UserName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void InitHandleType(FineUIPro.DropDownList dropName, bool isShowPlease, string state)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetDHandleTypeByState(state);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetDHandleTypeByState(string state)
|
||||
{
|
||||
if (state == Const.ConstructionPlan_Compile || state == Const.ConstructionPlan_ReCompile) //无是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[1];
|
||||
lis[0] = new ListItem("施工经理审核", Const.ConstructionPlan_Audit1);
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.ConstructionPlan_Audit1) //有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("施工管理部审核", Const.ConstructionPlan_Audit2);//是 加载
|
||||
lis[1] = new ListItem("重新编制", Const.ConstructionPlan_ReCompile);//否加载
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.ConstructionPlan_Audit2)//有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("项目经理批准", Const.ConstructionPlan_Audit3);
|
||||
lis[1] = new ListItem("施工经理审核", Const.ConstructionPlan_Audit1);
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.ConstructionPlan_Audit3)//有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("审批完成", Const.ConstructionPlan_Complete);//是 加载
|
||||
lis[1] = new ListItem("施工管理部审核", Const.ConstructionPlan_Audit2);//否加载
|
||||
return lis;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionReportApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string ConstructionReportId)
|
||||
{
|
||||
return from x in db.ZHGL_ConstructionReportApprove
|
||||
where x.ConstructionReportId == ConstructionReportId && x.ApproveDate != null
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructionReportApproveId,
|
||||
x.ConstructionReportId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据总承包商施工报告主键删除对应的所有总承包商施工报告审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">总承包商施工报告主键</param>
|
||||
public static void DeleteConstructionReportApproveByConstructionReportId(string noticeId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var data = (from x in db.ZHGL_ConstructionReportApprove where x.ConstructionReportId == noticeId select x).ToList();
|
||||
if (data != null)
|
||||
{
|
||||
db.ZHGL_ConstructionReportApprove.DeleteAllOnSubmit(data);
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加总承包商施工报告审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReportApprove">总承包商施工报告审批实体</param>
|
||||
public static void AddConstructionReportApprove(Model.ZHGL_ConstructionReportApprove ConstructionReportApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionReportApprove));
|
||||
Model.ZHGL_ConstructionReportApprove newConstructionReportApprove = new Model.ZHGL_ConstructionReportApprove();
|
||||
newConstructionReportApprove.ConstructionReportApproveId = newKeyID;
|
||||
newConstructionReportApprove.ConstructionReportId = ConstructionReportApprove.ConstructionReportId;
|
||||
newConstructionReportApprove.ApproveMan = ConstructionReportApprove.ApproveMan;
|
||||
newConstructionReportApprove.ApproveDate = ConstructionReportApprove.ApproveDate;
|
||||
newConstructionReportApprove.ApproveIdea = ConstructionReportApprove.ApproveIdea;
|
||||
newConstructionReportApprove.IsAgree = ConstructionReportApprove.IsAgree;
|
||||
newConstructionReportApprove.ApproveType = ConstructionReportApprove.ApproveType;
|
||||
|
||||
db.ZHGL_ConstructionReportApprove.InsertOnSubmit(newConstructionReportApprove);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
public static string AddConstructionReportApproveForApi(Model.ZHGL_ConstructionReportApprove ConstructionReportApprove)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionReportApprove));
|
||||
Model.ZHGL_ConstructionReportApprove newConstructionReportApprove = new Model.ZHGL_ConstructionReportApprove();
|
||||
newConstructionReportApprove.ConstructionReportApproveId = newKeyID;
|
||||
newConstructionReportApprove.ConstructionReportId = ConstructionReportApprove.ConstructionReportId;
|
||||
newConstructionReportApprove.ApproveMan = ConstructionReportApprove.ApproveMan;
|
||||
newConstructionReportApprove.ApproveDate = ConstructionReportApprove.ApproveDate;
|
||||
newConstructionReportApprove.ApproveIdea = ConstructionReportApprove.ApproveIdea;
|
||||
newConstructionReportApprove.IsAgree = ConstructionReportApprove.IsAgree;
|
||||
newConstructionReportApprove.ApproveType = ConstructionReportApprove.ApproveType;
|
||||
|
||||
db.ZHGL_ConstructionReportApprove.InsertOnSubmit(newConstructionReportApprove);
|
||||
db.SubmitChanges();
|
||||
return newKeyID;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据总承包商施工报告Id获取一个总承包商施工报告审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">总承包商施工报告Id</param>
|
||||
/// <returns>一个总承包商施工报告审批实体</returns>
|
||||
public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveByConstructionReportId(string constructionReportId)
|
||||
{
|
||||
return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == constructionReportId && x.ApproveDate == null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改总承包商施工报告审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReportApprove">总承包商施工报告审批实体</param>
|
||||
public static void UpdateConstructionReportApprove(Model.ZHGL_ConstructionReportApprove ConstructionReportApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionReportApprove newConstructionReportApprove = db.ZHGL_ConstructionReportApprove.First(e => e.ConstructionReportApproveId == ConstructionReportApprove.ConstructionReportApproveId);
|
||||
newConstructionReportApprove.ConstructionReportId = ConstructionReportApprove.ConstructionReportId;
|
||||
newConstructionReportApprove.ApproveMan = ConstructionReportApprove.ApproveMan;
|
||||
newConstructionReportApprove.ApproveDate = ConstructionReportApprove.ApproveDate;
|
||||
newConstructionReportApprove.ApproveIdea = ConstructionReportApprove.ApproveIdea;
|
||||
newConstructionReportApprove.IsAgree = ConstructionReportApprove.IsAgree;
|
||||
newConstructionReportApprove.ApproveType = ConstructionReportApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static Model.ZHGL_ConstructionReportApprove GetComplie(string ConstructionReportId)
|
||||
{
|
||||
return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == ConstructionReportId && x.ApproveType == BLL.Const.ConstructionReport_Compile);
|
||||
}
|
||||
public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveById(string ConstructionReportApproveId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportApproveId == ConstructionReportApproveId);
|
||||
}
|
||||
}
|
||||
public static List<Model.ZHGL_ConstructionReportApprove> getListDataByIdForApi(string ConstructionReportId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.ZHGL_ConstructionReportApprove
|
||||
where x.ConstructionReportId == ConstructionReportId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructionReportApproveId,
|
||||
x.ConstructionReportId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
|
||||
};
|
||||
List<Model.ZHGL_ConstructionReportApprove> res = new List<Model.ZHGL_ConstructionReportApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.ZHGL_ConstructionReportApprove wc = new Model.ZHGL_ConstructionReportApprove();
|
||||
wc.ConstructionReportApproveId = item.ConstructionReportApproveId;
|
||||
wc.ConstructionReportId = item.ConstructionReportId;
|
||||
wc.ApproveMan = item.ApproveMan;
|
||||
wc.ApproveDate = item.ApproveDate;
|
||||
wc.ApproveIdea = item.ApproveIdea;
|
||||
wc.IsAgree = item.IsAgree;
|
||||
wc.ApproveType = item.ApproveType;
|
||||
wc.ApproveMan = item.UserName;
|
||||
|
||||
res.Add(wc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.ZHGL_ConstructionReportApprove getCurrApproveForApi(string id)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ZHGL_ConstructionReportApprove newConstructionReportApprove = db.ZHGL_ConstructionReportApprove.FirstOrDefault(e => e.ConstructionReportId == id && e.ApproveDate == null);
|
||||
if (newConstructionReportApprove != null)
|
||||
{
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newConstructionReportApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
newConstructionReportApprove.ApproveIdea = user.UserName;
|
||||
}
|
||||
}
|
||||
return newConstructionReportApprove;
|
||||
}
|
||||
} /// <summary>
|
||||
/// 修改总承包商施工报告审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReportApprove">总承包商施工报告审批实体</param>
|
||||
public static void UpdateConstructionReportApproveForApi(Model.ZHGL_ConstructionReportApprove ConstructionReportApprove)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
Model.ZHGL_ConstructionReportApprove newConstructionReportApprove = db.ZHGL_ConstructionReportApprove.FirstOrDefault(e => e.ConstructionReportApproveId == ConstructionReportApprove.ConstructionReportApproveId);
|
||||
if (newConstructionReportApprove != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ConstructionReportApprove.ConstructionReportId))
|
||||
newConstructionReportApprove.ConstructionReportId = ConstructionReportApprove.ConstructionReportId;
|
||||
if (!string.IsNullOrEmpty(ConstructionReportApprove.ApproveMan))
|
||||
newConstructionReportApprove.ApproveMan = ConstructionReportApprove.ApproveMan;
|
||||
if (ConstructionReportApprove.ApproveDate.HasValue)
|
||||
newConstructionReportApprove.ApproveDate = ConstructionReportApprove.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(ConstructionReportApprove.ApproveIdea))
|
||||
newConstructionReportApprove.ApproveIdea = ConstructionReportApprove.ApproveIdea;
|
||||
if (ConstructionReportApprove.IsAgree.HasValue)
|
||||
newConstructionReportApprove.IsAgree = ConstructionReportApprove.IsAgree;
|
||||
if (!string.IsNullOrEmpty(ConstructionReportApprove.ApproveType))
|
||||
newConstructionReportApprove.ApproveType = ConstructionReportApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 总承包商施工报告
|
||||
/// </summary>
|
||||
public static class ConstructionReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取总承包商施工报告
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ConstructionReport GetConstructionReportById(string ConstructionReportId)
|
||||
{
|
||||
return Funs.DB.ZHGL_ConstructionReport.FirstOrDefault(e => e.ConstructionReportId == ConstructionReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加总承包商施工报告
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReport"></param>
|
||||
public static void AddConstructionReport(Model.ZHGL_ConstructionReport ConstructionReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionReport newConstructionReport = new Model.ZHGL_ConstructionReport
|
||||
{
|
||||
ConstructionReportId = ConstructionReport.ConstructionReportId,
|
||||
ProjectId = ConstructionReport.ProjectId,
|
||||
Code = ConstructionReport.Code,
|
||||
FileType = ConstructionReport.FileType,
|
||||
Content = ConstructionReport.Content,
|
||||
CompileMan = ConstructionReport.CompileMan,
|
||||
CompileDate = ConstructionReport.CompileDate,
|
||||
State = ConstructionReport.State,
|
||||
};
|
||||
db.ZHGL_ConstructionReport.InsertOnSubmit(newConstructionReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改总承包商施工报告
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReport"></param>
|
||||
public static void UpdateConstructionReport(Model.ZHGL_ConstructionReport ConstructionReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionReport newConstructionReport = db.ZHGL_ConstructionReport.FirstOrDefault(e => e.ConstructionReportId == ConstructionReport.ConstructionReportId);
|
||||
if (newConstructionReport != null)
|
||||
{
|
||||
newConstructionReport.Code = ConstructionReport.Code;
|
||||
newConstructionReport.Content = ConstructionReport.Content;
|
||||
newConstructionReport.State = ConstructionReport.State;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除总承包商施工报告
|
||||
/// </summary>
|
||||
/// <param name="ConstructionReportId"></param>
|
||||
public static void DeleteConstructionReportById(string ConstructionReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionReport ConstructionReport = db.ZHGL_ConstructionReport.FirstOrDefault(e => e.ConstructionReportId == ConstructionReportId);
|
||||
if (ConstructionReport != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ConstructionReport.ConstructionReportId);
|
||||
db.ZHGL_ConstructionReport.DeleteOnSubmit(ConstructionReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.ConstructionReport_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionReport_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionReport_Audit1)
|
||||
{
|
||||
return "施工经理批准";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ConstructionReport_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetFileTypeList()
|
||||
{
|
||||
ListItem[] lis = new ListItem[5];
|
||||
lis[0] = new ListItem("施工周报告", "1");
|
||||
lis[1] = new ListItem("施工月报告", "2");
|
||||
lis[2] = new ListItem("施工开工报告", "3");
|
||||
lis[3] = new ListItem("施工完工报告", "4");
|
||||
lis[4] = new ListItem("施工专题报告", "5");
|
||||
return lis;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertFileType(object FileType)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (FileType != null)
|
||||
{
|
||||
var fileType = GetFileTypeList().FirstOrDefault(x => x.Value == FileType.ToString());
|
||||
if (fileType != null)
|
||||
{
|
||||
name = fileType.Text;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
//<summary>
|
||||
//获取办理人姓名
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
public static string ConvertMan(object ConstructionReportId)
|
||||
{
|
||||
if (ConstructionReportId != null)
|
||||
{
|
||||
Model.ZHGL_ConstructionReportApprove a = ConstructionReportApproveService.GetConstructionReportApproveByConstructionReportId(ConstructionReportId.ToString());
|
||||
if (a != null)
|
||||
{
|
||||
if (a.ApproveMan != null)
|
||||
{
|
||||
return UserService.GetUserByUserId(a.ApproveMan).UserName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void InitHandleType(FineUIPro.DropDownList dropName, bool isShowPlease, string state)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetDHandleTypeByState(state);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetDHandleTypeByState(string state)
|
||||
{
|
||||
if (state == Const.ConstructionReport_Compile || state == Const.ConstructionReport_ReCompile) //无是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[1];
|
||||
lis[0] = new ListItem("施工经理批准", Const.ConstructionReport_Audit1);
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.ConstructionReport_Audit1) //有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("审批完成", Const.ConstructionReport_Complete);//是 加载
|
||||
lis[1] = new ListItem("重新编制", Const.ConstructionReport_ReCompile);//否加载
|
||||
return lis;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目图片
|
||||
/// </summary>
|
||||
public static class PictureService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取项目图片
|
||||
/// </summary>
|
||||
/// <param name="pictureId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_Picture GetPictureById(string pictureId)
|
||||
{
|
||||
return Funs.DB.InformationProject_Picture.FirstOrDefault(e => e.PictureId == pictureId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加图片信息
|
||||
/// </summary>
|
||||
/// <param name="personQuality">图片实体</param>
|
||||
public static void AddPicture(Model.InformationProject_Picture picture)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_Picture newPicture = new Model.InformationProject_Picture
|
||||
{
|
||||
PictureId = picture.PictureId,
|
||||
ProjectId = picture.ProjectId,
|
||||
Title = picture.Title,
|
||||
ContentDef = picture.ContentDef,
|
||||
UploadDate = picture.UploadDate,
|
||||
PictureType = picture.PictureType,
|
||||
States = picture.States,
|
||||
AttachUrl = picture.AttachUrl,
|
||||
CompileMan = picture.CompileMan
|
||||
};
|
||||
db.InformationProject_Picture.InsertOnSubmit(newPicture);
|
||||
db.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectPictureMenuId, newPicture.ProjectId, null, newPicture.PictureId, newPicture.UploadDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目图片
|
||||
/// </summary>
|
||||
/// <param name="picture"></param>
|
||||
public static void UpdatePicture(Model.InformationProject_Picture picture)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_Picture newPicture = db.InformationProject_Picture.FirstOrDefault(e => e.PictureId == picture.PictureId);
|
||||
if (newPicture != null)
|
||||
{
|
||||
//newPicture.ProjectId = picture.ProjectId;
|
||||
newPicture.Title = picture.Title;
|
||||
newPicture.ContentDef = picture.ContentDef;
|
||||
newPicture.UploadDate = picture.UploadDate;
|
||||
newPicture.PictureType = picture.PictureType;
|
||||
newPicture.States = picture.States;
|
||||
newPicture.AttachUrl = picture.AttachUrl;
|
||||
newPicture.CompileMan = picture.CompileMan;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除项目图片
|
||||
/// </summary>
|
||||
/// <param name="pictureId"></param>
|
||||
public static void deletePictureById(string pictureId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_Picture picture = db.InformationProject_Picture.FirstOrDefault(e => e.PictureId == pictureId);
|
||||
if (picture != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(picture.PictureId);
|
||||
BLL.CommonService.DeleteAttachFileById(picture.PictureId); ///删除附件
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, picture.AttachUrl); ///删除附件
|
||||
//////删除审核流程
|
||||
BLL.CommonService.DeleteFlowOperateByID(picture.PictureId);
|
||||
db.InformationProject_Picture.DeleteOnSubmit(picture);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 一般来文
|
||||
/// </summary>
|
||||
public static class ReceiveFileManagerService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取一般来文
|
||||
/// </summary>
|
||||
/// <param name="ReceiveFileManagerId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_ReceiveFileManager GetReceiveFileManagerById(string ReceiveFileManagerId)
|
||||
{
|
||||
return Funs.DB.InformationProject_ReceiveFileManager.FirstOrDefault(e => e.ReceiveFileManagerId == ReceiveFileManagerId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加一般来文
|
||||
/// </summary>
|
||||
/// <param name="ReceiveFileManager"></param>
|
||||
public static void AddReceiveFileManager(Model.InformationProject_ReceiveFileManager ReceiveFileManager)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ReceiveFileManager newReceiveFileManager = new Model.InformationProject_ReceiveFileManager
|
||||
{
|
||||
ReceiveFileManagerId = ReceiveFileManager.ReceiveFileManagerId,
|
||||
ProjectId = ReceiveFileManager.ProjectId,
|
||||
ReceiveFileCode = ReceiveFileManager.ReceiveFileCode,
|
||||
ReceiveFileName = ReceiveFileManager.ReceiveFileName,
|
||||
Version = ReceiveFileManager.Version,
|
||||
FileUnitId = ReceiveFileManager.FileUnitId,
|
||||
FileCode = ReceiveFileManager.FileCode,
|
||||
FilePageNum = ReceiveFileManager.FilePageNum,
|
||||
GetFileDate = ReceiveFileManager.GetFileDate,
|
||||
SendPersonId = ReceiveFileManager.SendPersonId,
|
||||
MainContent = ReceiveFileManager.MainContent,
|
||||
AttachUrl = ReceiveFileManager.AttachUrl,
|
||||
States = ReceiveFileManager.States,
|
||||
UnitIds = ReceiveFileManager.UnitIds,
|
||||
FileType=ReceiveFileManager.FileType,
|
||||
FromId=ReceiveFileManager.FromId,
|
||||
FromType=ReceiveFileManager.FromType,
|
||||
};
|
||||
db.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ReceiveFileManagerMenuId, ReceiveFileManager.ProjectId, null, ReceiveFileManager.ReceiveFileManagerId, ReceiveFileManager.GetFileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改一般来文
|
||||
/// </summary>
|
||||
/// <param name="ReceiveFileManager"></param>
|
||||
public static void UpdateReceiveFileManager(Model.InformationProject_ReceiveFileManager ReceiveFileManager)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ReceiveFileManager newReceiveFileManager = db.InformationProject_ReceiveFileManager.FirstOrDefault(e => e.ReceiveFileManagerId == ReceiveFileManager.ReceiveFileManagerId);
|
||||
if (newReceiveFileManager != null)
|
||||
{
|
||||
// newReceiveFileManager.ReceiveFileCode = ReceiveFileManager.ReceiveFileCode;
|
||||
newReceiveFileManager.ReceiveFileName = ReceiveFileManager.ReceiveFileName;
|
||||
newReceiveFileManager.Version = ReceiveFileManager.Version;
|
||||
newReceiveFileManager.FileUnitId = ReceiveFileManager.FileUnitId;
|
||||
newReceiveFileManager.FileCode = ReceiveFileManager.FileCode;
|
||||
newReceiveFileManager.FilePageNum = ReceiveFileManager.FilePageNum;
|
||||
newReceiveFileManager.GetFileDate = ReceiveFileManager.GetFileDate;
|
||||
newReceiveFileManager.SendPersonId = ReceiveFileManager.SendPersonId;
|
||||
newReceiveFileManager.MainContent = ReceiveFileManager.MainContent;
|
||||
newReceiveFileManager.AttachUrl = ReceiveFileManager.AttachUrl;
|
||||
newReceiveFileManager.States = ReceiveFileManager.States;
|
||||
newReceiveFileManager.UnitIds = ReceiveFileManager.UnitIds;
|
||||
newReceiveFileManager.FileType = ReceiveFileManager.FileType;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除一般来文
|
||||
/// </summary>
|
||||
/// <param name="ReceiveFileManagerId"></param>
|
||||
public static void DeleteReceiveFileManagerById(string ReceiveFileManagerId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ReceiveFileManager ReceiveFileManager = db.InformationProject_ReceiveFileManager.FirstOrDefault(e => e.ReceiveFileManagerId == ReceiveFileManagerId);
|
||||
if (ReceiveFileManager != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(ReceiveFileManager.ReceiveFileManagerId);
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ReceiveFileManager.ReceiveFileManagerId);
|
||||
////删除流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(ReceiveFileManager.ReceiveFileManagerId);
|
||||
db.InformationProject_ReceiveFileManager.DeleteOnSubmit(ReceiveFileManager);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据通知 公司通知生成公司来文 项目通知生成项目来文
|
||||
/// </summary>
|
||||
public static void CreateReceiveFile(Model.InformationProject_Notice notice)
|
||||
{
|
||||
var getProjects = Funs.GetStrListByStr(notice.AccessProjectId, ',');
|
||||
string unitId =Const.UnitId_CWCEC;
|
||||
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == notice.NoticeId);
|
||||
foreach (var item in getProjects)
|
||||
{
|
||||
Model.InformationProject_ReceiveFileManager newFile = new Model.InformationProject_ReceiveFileManager
|
||||
{
|
||||
ReceiveFileManagerId = SQLHelper.GetNewID(),
|
||||
ProjectId = item,
|
||||
ReceiveFileCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ReceiveFileManagerMenuId, item, unitId),
|
||||
ReceiveFileName = notice.NoticeTitle,
|
||||
Version = "V1.0",
|
||||
FileUnitId = unitId,
|
||||
FileCode = notice.NoticeCode,
|
||||
FilePageNum = 1,
|
||||
GetFileDate = DateTime.Now,
|
||||
SendPersonId = notice.CompileMan,
|
||||
MainContent = notice.MainContent,
|
||||
FromId=notice.NoticeId,
|
||||
FromType ="1",
|
||||
};
|
||||
if (!string.IsNullOrEmpty(notice.ProjectId))
|
||||
{
|
||||
newFile.FileType = "0";
|
||||
var getPUnits = Funs.DB.Project_ProjectUnit.Where(x => x.ProjectId == item);
|
||||
foreach (var uItem in getPUnits)
|
||||
{
|
||||
if (string.IsNullOrEmpty(newFile.UnitIds))
|
||||
{
|
||||
newFile.UnitIds = uItem.UnitId;
|
||||
}
|
||||
else
|
||||
{
|
||||
newFile.UnitIds += "," + uItem.UnitId;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newFile.FileType = "1";
|
||||
newFile.UnitIds = unitId;
|
||||
}
|
||||
|
||||
newFile.States = Const.State_2;
|
||||
ReceiveFileManagerService.AddReceiveFileManager(newFile);
|
||||
if (getAtt != null && !string.IsNullOrEmpty(getAtt.AttachUrl))
|
||||
{
|
||||
APIUpLoadFileService.SaveAttachUrl(Const.ReceiveFileManagerMenuId, newFile.ReceiveFileManagerId, getAtt.AttachUrl, "0");
|
||||
}
|
||||
CommonService.btnSaveData(item, Const.ReceiveFileManagerMenuId, newFile.ReceiveFileManagerId, newFile.SendPersonId, true, newFile.ReceiveFileName, "../InformationProject/ReceiveFileManagerView.aspx?ReceiveFileManagerId={0}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据通知 公司通知生成公司来文 项目通知生成项目来文
|
||||
/// </summary>
|
||||
public static void IssueReceiveFile(string receiveFileManagerId)
|
||||
{
|
||||
var getFile = Funs.DB.InformationProject_ReceiveFileManager.FirstOrDefault(x => x.ReceiveFileManagerId == receiveFileManagerId);
|
||||
if (getFile != null && getFile.FileType == "1")
|
||||
{
|
||||
var getPUnits = Funs.DB.Project_ProjectUnit.Where(x => x.ProjectId == getFile.ProjectId);
|
||||
foreach (var uItem in getPUnits)
|
||||
{
|
||||
if (string.IsNullOrEmpty(getFile.UnitIds))
|
||||
{
|
||||
getFile.UnitIds = uItem.UnitId;
|
||||
}
|
||||
else
|
||||
{
|
||||
getFile.UnitIds += "," + uItem.UnitId;
|
||||
}
|
||||
}
|
||||
|
||||
Model.InformationProject_ReceiveFileManager newReceiveFileManager = new Model.InformationProject_ReceiveFileManager
|
||||
{
|
||||
ReceiveFileManagerId = SQLHelper.GetNewID(),
|
||||
ProjectId = getFile.ProjectId,
|
||||
ReceiveFileName = getFile.ReceiveFileName,
|
||||
Version = getFile.Version,
|
||||
FileUnitId = getFile.FileUnitId,
|
||||
FileCode = getFile.FileCode,
|
||||
FilePageNum = getFile.FilePageNum,
|
||||
GetFileDate = getFile.GetFileDate,
|
||||
SendPersonId = getFile.SendPersonId,
|
||||
MainContent = getFile.MainContent,
|
||||
AttachUrl = getFile.AttachUrl,
|
||||
States = getFile.States,
|
||||
UnitIds = getFile.UnitIds,
|
||||
};
|
||||
|
||||
newReceiveFileManager.ReceiveFileManagerId = SQLHelper.GetNewID();
|
||||
newReceiveFileManager.ReceiveFileCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ReceiveFileManagerMenuId, newReceiveFileManager.ProjectId, newReceiveFileManager.FileUnitId);
|
||||
newReceiveFileManager.FileType = "0";
|
||||
newReceiveFileManager.FromId = getFile.ReceiveFileManagerId;
|
||||
newReceiveFileManager.FromType = "2";
|
||||
|
||||
db.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ReceiveFileManagerMenuId, newReceiveFileManager.ProjectId, null, newReceiveFileManager.ReceiveFileManagerId, newReceiveFileManager.GetFileDate);
|
||||
|
||||
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == getFile.ReceiveFileManagerId);
|
||||
if (getAtt != null && !string.IsNullOrEmpty(getAtt.AttachUrl))
|
||||
{
|
||||
APIUpLoadFileService.SaveAttachUrl(Const.ReceiveFileManagerMenuId, newReceiveFileManager.ReceiveFileManagerId, getAtt.AttachUrl, "0");
|
||||
}
|
||||
CommonService.btnSaveData(getFile.ProjectId, Const.ReceiveFileManagerMenuId, newReceiveFileManager.ReceiveFileManagerId, newReceiveFileManager.SendPersonId, true, newReceiveFileManager.ReceiveFileName, "../InformationProject/ReceiveFileManagerView.aspx?ReceiveFileManagerId={0}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class WorkHandoverApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string WorkHandoverId)
|
||||
{
|
||||
return from x in db.ZHGL_WorkHandoverApprove
|
||||
where x.WorkHandoverId == WorkHandoverId && x.ApproveDate != null
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.WorkHandoverApproveId,
|
||||
x.WorkHandoverId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据工作交接主键删除对应的所有工作交接审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">工作交接主键</param>
|
||||
public static void DeleteWorkHandoverApproveByWorkHandoverId(string noticeId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var data = (from x in db.ZHGL_WorkHandoverApprove where x.WorkHandoverId == noticeId select x).ToList();
|
||||
if (data != null)
|
||||
{
|
||||
db.ZHGL_WorkHandoverApprove.DeleteAllOnSubmit(data);
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加工作交接审批信息
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverApprove">工作交接审批实体</param>
|
||||
public static void AddWorkHandoverApprove(Model.ZHGL_WorkHandoverApprove WorkHandoverApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_WorkHandoverApprove));
|
||||
Model.ZHGL_WorkHandoverApprove newWorkHandoverApprove = new Model.ZHGL_WorkHandoverApprove();
|
||||
newWorkHandoverApprove.WorkHandoverApproveId = newKeyID;
|
||||
newWorkHandoverApprove.WorkHandoverId = WorkHandoverApprove.WorkHandoverId;
|
||||
newWorkHandoverApprove.ApproveMan = WorkHandoverApprove.ApproveMan;
|
||||
newWorkHandoverApprove.ApproveDate = WorkHandoverApprove.ApproveDate;
|
||||
newWorkHandoverApprove.ApproveIdea = WorkHandoverApprove.ApproveIdea;
|
||||
newWorkHandoverApprove.IsAgree = WorkHandoverApprove.IsAgree;
|
||||
newWorkHandoverApprove.ApproveType = WorkHandoverApprove.ApproveType;
|
||||
|
||||
db.ZHGL_WorkHandoverApprove.InsertOnSubmit(newWorkHandoverApprove);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
public static string AddWorkHandoverApproveForApi(Model.ZHGL_WorkHandoverApprove WorkHandoverApprove)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.ZHGL_WorkHandoverApprove));
|
||||
Model.ZHGL_WorkHandoverApprove newWorkHandoverApprove = new Model.ZHGL_WorkHandoverApprove();
|
||||
newWorkHandoverApprove.WorkHandoverApproveId = newKeyID;
|
||||
newWorkHandoverApprove.WorkHandoverId = WorkHandoverApprove.WorkHandoverId;
|
||||
newWorkHandoverApprove.ApproveMan = WorkHandoverApprove.ApproveMan;
|
||||
newWorkHandoverApprove.ApproveDate = WorkHandoverApprove.ApproveDate;
|
||||
newWorkHandoverApprove.ApproveIdea = WorkHandoverApprove.ApproveIdea;
|
||||
newWorkHandoverApprove.IsAgree = WorkHandoverApprove.IsAgree;
|
||||
newWorkHandoverApprove.ApproveType = WorkHandoverApprove.ApproveType;
|
||||
|
||||
db.ZHGL_WorkHandoverApprove.InsertOnSubmit(newWorkHandoverApprove);
|
||||
db.SubmitChanges();
|
||||
return newKeyID;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据工作交接Id获取一个工作交接审批信息
|
||||
/// </summary>
|
||||
/// <param name="noticeId">工作交接Id</param>
|
||||
/// <returns>一个工作交接审批实体</returns>
|
||||
public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveByWorkHandoverId(string constructionPlanId)
|
||||
{
|
||||
return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == constructionPlanId && x.ApproveDate == null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改工作交接审批信息
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverApprove">工作交接审批实体</param>
|
||||
public static void UpdateWorkHandoverApprove(Model.ZHGL_WorkHandoverApprove WorkHandoverApprove)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_WorkHandoverApprove newWorkHandoverApprove = db.ZHGL_WorkHandoverApprove.First(e => e.WorkHandoverApproveId == WorkHandoverApprove.WorkHandoverApproveId);
|
||||
newWorkHandoverApprove.WorkHandoverId = WorkHandoverApprove.WorkHandoverId;
|
||||
newWorkHandoverApprove.ApproveMan = WorkHandoverApprove.ApproveMan;
|
||||
newWorkHandoverApprove.ApproveDate = WorkHandoverApprove.ApproveDate;
|
||||
newWorkHandoverApprove.ApproveIdea = WorkHandoverApprove.ApproveIdea;
|
||||
newWorkHandoverApprove.IsAgree = WorkHandoverApprove.IsAgree;
|
||||
newWorkHandoverApprove.ApproveType = WorkHandoverApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static Model.ZHGL_WorkHandoverApprove GetComplie(string WorkHandoverId)
|
||||
{
|
||||
return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == WorkHandoverId && x.ApproveType == BLL.Const.WorkHandover_Compile);
|
||||
}
|
||||
public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveById(string WorkHandoverApproveId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverApproveId == WorkHandoverApproveId);
|
||||
}
|
||||
}
|
||||
public static List<Model.ZHGL_WorkHandoverApprove> getListDataByIdForApi(string WorkHandoverId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.ZHGL_WorkHandoverApprove
|
||||
where x.WorkHandoverId == WorkHandoverId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.WorkHandoverApproveId,
|
||||
x.WorkHandoverId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.ApproveIdea,
|
||||
x.IsAgree,
|
||||
x.ApproveType,
|
||||
UserName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
|
||||
};
|
||||
List<Model.ZHGL_WorkHandoverApprove> res = new List<Model.ZHGL_WorkHandoverApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.ZHGL_WorkHandoverApprove wc = new Model.ZHGL_WorkHandoverApprove();
|
||||
wc.WorkHandoverApproveId = item.WorkHandoverApproveId;
|
||||
wc.WorkHandoverId = item.WorkHandoverId;
|
||||
wc.ApproveMan = item.ApproveMan;
|
||||
wc.ApproveDate = item.ApproveDate;
|
||||
wc.ApproveIdea = item.ApproveIdea;
|
||||
wc.IsAgree = item.IsAgree;
|
||||
wc.ApproveType = item.ApproveType;
|
||||
wc.ApproveMan = item.UserName;
|
||||
|
||||
res.Add(wc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.ZHGL_WorkHandoverApprove getCurrApproveForApi(string id)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ZHGL_WorkHandoverApprove newWorkHandoverApprove = db.ZHGL_WorkHandoverApprove.FirstOrDefault(e => e.WorkHandoverId == id && e.ApproveDate == null);
|
||||
if (newWorkHandoverApprove != null)
|
||||
{
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newWorkHandoverApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
newWorkHandoverApprove.ApproveIdea = user.UserName;
|
||||
}
|
||||
}
|
||||
return newWorkHandoverApprove;
|
||||
}
|
||||
} /// <summary>
|
||||
/// 修改工作交接审批信息
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverApprove">工作交接审批实体</param>
|
||||
public static void UpdateWorkHandoverApproveForApi(Model.ZHGL_WorkHandoverApprove WorkHandoverApprove)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
|
||||
Model.ZHGL_WorkHandoverApprove newWorkHandoverApprove = db.ZHGL_WorkHandoverApprove.FirstOrDefault(e => e.WorkHandoverApproveId == WorkHandoverApprove.WorkHandoverApproveId);
|
||||
if (newWorkHandoverApprove != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(WorkHandoverApprove.WorkHandoverId))
|
||||
newWorkHandoverApprove.WorkHandoverId = WorkHandoverApprove.WorkHandoverId;
|
||||
if (!string.IsNullOrEmpty(WorkHandoverApprove.ApproveMan))
|
||||
newWorkHandoverApprove.ApproveMan = WorkHandoverApprove.ApproveMan;
|
||||
if (WorkHandoverApprove.ApproveDate.HasValue)
|
||||
newWorkHandoverApprove.ApproveDate = WorkHandoverApprove.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(WorkHandoverApprove.ApproveIdea))
|
||||
newWorkHandoverApprove.ApproveIdea = WorkHandoverApprove.ApproveIdea;
|
||||
if (WorkHandoverApprove.IsAgree.HasValue)
|
||||
newWorkHandoverApprove.IsAgree = WorkHandoverApprove.IsAgree;
|
||||
if (!string.IsNullOrEmpty(WorkHandoverApprove.ApproveType))
|
||||
newWorkHandoverApprove.ApproveType = WorkHandoverApprove.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class WorkHandoverDetailService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取工作交接明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string WorkHandoverId)
|
||||
{
|
||||
return from x in db.ZHGL_WorkHandoverDetail
|
||||
where x.WorkHandoverId == WorkHandoverId
|
||||
select new
|
||||
{
|
||||
x.WorkHandoverDetailId,
|
||||
x.WorkHandoverId,
|
||||
x.SortIndex,
|
||||
x.HandoverContent,
|
||||
x.Num,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加月报质量验收情况
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">月报质量验收情况实体</param>
|
||||
public static void AddMonthSpotCheckDetail(Model.ZHGL_WorkHandoverDetail monthSpotCheckDetail)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_WorkHandoverDetail newApprove = new Model.ZHGL_WorkHandoverDetail();
|
||||
newApprove.WorkHandoverDetailId = monthSpotCheckDetail.WorkHandoverDetailId;
|
||||
newApprove.WorkHandoverId = monthSpotCheckDetail.WorkHandoverId;
|
||||
newApprove.SortIndex = monthSpotCheckDetail.SortIndex;
|
||||
newApprove.HandoverContent = monthSpotCheckDetail.HandoverContent;
|
||||
newApprove.Num = monthSpotCheckDetail.Num;
|
||||
|
||||
db.ZHGL_WorkHandoverDetail.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有月报质量验收情况
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverId">月报质量验收情况编号</param>
|
||||
public static void DeleteMonthSpotCheckDetailsByWorkHandoverId(string WorkHandoverId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_WorkHandoverDetail where x.WorkHandoverId == WorkHandoverId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_WorkHandoverDetail.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id获取对应的所有月报质量验收情况
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverId">月报质量验收情况编号</param>
|
||||
public static List<Model.ZHGL_WorkHandoverDetail> GetWorkHandoverDetailsByWorkHandoverId(string WorkHandoverId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in db.ZHGL_WorkHandoverDetail where x.WorkHandoverId == WorkHandoverId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 工作交接
|
||||
/// </summary>
|
||||
public static class WorkHandoverService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取工作交接
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_WorkHandover GetWorkHandoverById(string WorkHandoverId)
|
||||
{
|
||||
return Funs.DB.ZHGL_WorkHandover.FirstOrDefault(e => e.WorkHandoverId == WorkHandoverId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加工作交接
|
||||
/// </summary>
|
||||
/// <param name="WorkHandover"></param>
|
||||
public static void AddWorkHandover(Model.ZHGL_WorkHandover WorkHandover)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_WorkHandover newWorkHandover = new Model.ZHGL_WorkHandover
|
||||
{
|
||||
WorkHandoverId = WorkHandover.WorkHandoverId,
|
||||
ProjectId = WorkHandover.ProjectId,
|
||||
TransferMan = WorkHandover.TransferMan,
|
||||
TransferManDepart = WorkHandover.TransferManDepart,
|
||||
ReceiveMan = WorkHandover.ReceiveMan,
|
||||
ReceiveManDepart = WorkHandover.ReceiveManDepart,
|
||||
WorkPostId = WorkHandover.WorkPostId,
|
||||
TransferDate = WorkHandover.TransferDate,
|
||||
State = WorkHandover.State,
|
||||
};
|
||||
db.ZHGL_WorkHandover.InsertOnSubmit(newWorkHandover);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改工作交接
|
||||
/// </summary>
|
||||
/// <param name="WorkHandover"></param>
|
||||
public static void UpdateWorkHandover(Model.ZHGL_WorkHandover WorkHandover)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_WorkHandover newWorkHandover = db.ZHGL_WorkHandover.FirstOrDefault(e => e.WorkHandoverId == WorkHandover.WorkHandoverId);
|
||||
if (newWorkHandover != null)
|
||||
{
|
||||
newWorkHandover.TransferMan = WorkHandover.TransferMan;
|
||||
newWorkHandover.TransferManDepart = WorkHandover.TransferManDepart;
|
||||
newWorkHandover.ReceiveMan = WorkHandover.ReceiveMan;
|
||||
newWorkHandover.ReceiveManDepart = WorkHandover.ReceiveManDepart;
|
||||
newWorkHandover.WorkPostId = WorkHandover.WorkPostId;
|
||||
newWorkHandover.TransferDate = WorkHandover.TransferDate;
|
||||
newWorkHandover.State = WorkHandover.State;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除工作交接
|
||||
/// </summary>
|
||||
/// <param name="WorkHandoverId"></param>
|
||||
public static void DeleteWorkHandoverById(string WorkHandoverId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_WorkHandover WorkHandover = db.ZHGL_WorkHandover.FirstOrDefault(e => e.WorkHandoverId == WorkHandoverId);
|
||||
if (WorkHandover != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(WorkHandover.WorkHandoverId);
|
||||
db.ZHGL_WorkHandover.DeleteOnSubmit(WorkHandover);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.WorkHandover_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.WorkHandover_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.WorkHandover_Audit1)
|
||||
{
|
||||
return "接收人确认";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.WorkHandover_Audit2)
|
||||
{
|
||||
return "移交人主管确认";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.WorkHandover_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
//<summary>
|
||||
//获取办理人姓名
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
public static string ConvertMan(object WorkHandoverId)
|
||||
{
|
||||
if (WorkHandoverId != null)
|
||||
{
|
||||
Model.ZHGL_WorkHandoverApprove a = WorkHandoverApproveService.GetWorkHandoverApproveByWorkHandoverId(WorkHandoverId.ToString());
|
||||
if (a != null)
|
||||
{
|
||||
if (a.ApproveMan != null)
|
||||
{
|
||||
return UserService.GetUserByUserId(a.ApproveMan).UserName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void InitHandleType(FineUIPro.DropDownList dropName, bool isShowPlease, string state)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetDHandleTypeByState(state);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetDHandleTypeByState(string state)
|
||||
{
|
||||
if (state == Const.WorkHandover_Compile || state == Const.WorkHandover_ReCompile) //无是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[1];
|
||||
lis[0] = new ListItem("接收人确认", Const.WorkHandover_Audit1);
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.WorkHandover_Audit1) //有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("移交人主管确认", Const.WorkHandover_Audit2);//是 加载
|
||||
lis[1] = new ListItem("重新编制", Const.WorkHandover_ReCompile);//否加载
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.WorkHandover_Audit2)//有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("审批完成", Const.WorkHandover_Complete);//是 加载
|
||||
lis[1] = new ListItem("接收人确认", Const.WorkHandover_Audit1);//否加载
|
||||
return lis;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目地图
|
||||
/// </summary>
|
||||
public static class ProjectMapService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取项目地图
|
||||
/// </summary>
|
||||
/// <param name="ProjectMapId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_ProjectMap GetProjectMapById(string ProjectMapId)
|
||||
{
|
||||
return Funs.DB.InformationProject_ProjectMap.FirstOrDefault(e => e.ProjectMapId == ProjectMapId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加地图信息
|
||||
/// </summary>
|
||||
/// <param name="personQuality">地图实体</param>
|
||||
public static void AddProjectMap(Model.InformationProject_ProjectMap ProjectMap)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ProjectMap newProjectMap = new Model.InformationProject_ProjectMap
|
||||
{
|
||||
ProjectMapId = ProjectMap.ProjectMapId,
|
||||
ProjectId = ProjectMap.ProjectId,
|
||||
Title = ProjectMap.Title,
|
||||
ContentDef = ProjectMap.ContentDef,
|
||||
UploadDate = ProjectMap.UploadDate,
|
||||
MapType = ProjectMap.MapType,
|
||||
AttachUrl = ProjectMap.AttachUrl,
|
||||
CompileMan = ProjectMap.CompileMan
|
||||
};
|
||||
db.InformationProject_ProjectMap.InsertOnSubmit(newProjectMap);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目地图
|
||||
/// </summary>
|
||||
/// <param name="ProjectMap"></param>
|
||||
public static void UpdateProjectMap(Model.InformationProject_ProjectMap ProjectMap)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ProjectMap newProjectMap = db.InformationProject_ProjectMap.FirstOrDefault(e => e.ProjectMapId == ProjectMap.ProjectMapId);
|
||||
if (newProjectMap != null)
|
||||
{
|
||||
//newProjectMap.ProjectId = ProjectMap.ProjectId;
|
||||
newProjectMap.Title = ProjectMap.Title;
|
||||
newProjectMap.ContentDef = ProjectMap.ContentDef;
|
||||
newProjectMap.UploadDate = ProjectMap.UploadDate;
|
||||
newProjectMap.MapType = ProjectMap.MapType;
|
||||
newProjectMap.AttachUrl = ProjectMap.AttachUrl;
|
||||
newProjectMap.CompileMan = ProjectMap.CompileMan;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除项目地图
|
||||
/// </summary>
|
||||
/// <param name="ProjectMapId"></param>
|
||||
public static void deleteProjectMapById(string ProjectMapId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ProjectMap ProjectMap = db.InformationProject_ProjectMap.FirstOrDefault(e => e.ProjectMapId == ProjectMapId);
|
||||
if (ProjectMap != null)
|
||||
{
|
||||
BLL.CommonService.DeleteAttachFileById(ProjectMap.ProjectMapId); ///删除附件
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, ProjectMap.AttachUrl); ///删除附件
|
||||
|
||||
db.InformationProject_ProjectMap.DeleteOnSubmit(ProjectMap);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
namespace BLL
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
using System;
|
||||
|
||||
public static class ProjectPageDataService
|
||||
{
|
||||
public static SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
///获取移动端首页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Wx_PageData GetPageDataByPageDataId(string PageDataId)
|
||||
{
|
||||
return Funs.DB.Wx_PageData.FirstOrDefault(e => e.PageDataId == PageDataId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加移动端首页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static void AddPageData(Wx_PageData PageData)
|
||||
{
|
||||
SGGLDB db = Funs.DB;
|
||||
Wx_PageData newPageData = new Wx_PageData
|
||||
{
|
||||
PageDataId = PageData.PageDataId,
|
||||
ProjectId = PageData.ProjectId,
|
||||
CreatDate = DateTime.Now,
|
||||
CreatManId = PageData.CreatManId,
|
||||
SafeHours = PageData.SafeHours,
|
||||
SitePersonNum = PageData.SitePersonNum,
|
||||
SpecialEquipmentNum = PageData.SpecialEquipmentNum,
|
||||
EntryTrainingNum = PageData.EntryTrainingNum,
|
||||
HiddenDangerNum = PageData.HiddenDangerNum,
|
||||
RectificationNum = PageData.RectificationNum,
|
||||
RiskI = PageData.RiskI,
|
||||
RiskII = PageData.RiskII,
|
||||
RiskIII = PageData.RiskIII,
|
||||
RiskIV = PageData.RiskIV,
|
||||
RiskV = PageData.RiskV,
|
||||
};
|
||||
db.Wx_PageData.InsertOnSubmit(newPageData);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///修改移动端首页
|
||||
/// </summary>
|
||||
/// <param name="PageData"></param>
|
||||
public static void UpdatePageData(Wx_PageData PageData)
|
||||
{
|
||||
SGGLDB db = Funs.DB;
|
||||
Wx_PageData newPageData = db.Wx_PageData.FirstOrDefault(e => e.PageDataId == PageData.PageDataId);
|
||||
if (newPageData != null)
|
||||
{
|
||||
newPageData.SafeHours = PageData.SafeHours;
|
||||
newPageData.SitePersonNum = PageData.SitePersonNum;
|
||||
newPageData.SpecialEquipmentNum = PageData.SpecialEquipmentNum;
|
||||
newPageData.EntryTrainingNum = PageData.EntryTrainingNum;
|
||||
newPageData.HiddenDangerNum = PageData.HiddenDangerNum;
|
||||
newPageData.RectificationNum = PageData.RectificationNum;
|
||||
newPageData.RiskI = PageData.RiskI;
|
||||
newPageData.RiskII = PageData.RiskII;
|
||||
newPageData.RiskIII = PageData.RiskIII;
|
||||
newPageData.RiskIV = PageData.RiskIV;
|
||||
newPageData.RiskV = PageData.RiskV;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user