115 lines
4.2 KiB
C#
115 lines
4.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace BLL
|
|
{
|
|
public class WorkOrderFinalService
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 根据方案审查Id删除一个方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolutionCode">方案审查Id</param>
|
|
public static void DeleteWorkOrder(string WorkOrderFinalId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_WorkOrder_Final visaApplication_Final = db.CQMS_WorkOrder_Final.First(e => e.WorkOrderFinalId == WorkOrderFinalId);
|
|
|
|
db.CQMS_WorkOrder_Final.DeleteOnSubmit(visaApplication_Final);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void AddWorkOrder(Model.CQMS_WorkOrder_Final constructSolution)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_WorkOrder_Final newConstructSolution = new Model.CQMS_WorkOrder_Final();
|
|
newConstructSolution.WorkOrderFinalId = constructSolution.WorkOrderFinalId;
|
|
newConstructSolution.ProjectId = constructSolution.ProjectId;
|
|
newConstructSolution.UnitId = constructSolution.UnitId;
|
|
newConstructSolution.CompileMan = constructSolution.CompileMan;
|
|
newConstructSolution.State = constructSolution.State;
|
|
newConstructSolution.CompileDate = constructSolution.CompileDate;
|
|
|
|
db.CQMS_WorkOrder_Final.InsertOnSubmit(newConstructSolution);
|
|
db.SubmitChanges();
|
|
}
|
|
/// <summary>
|
|
/// 修改方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void UpdateWorkOrder(Model.CQMS_WorkOrder_Final constructSolution)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_WorkOrder_Final newConstructSolution = db.CQMS_WorkOrder_Final.FirstOrDefault(e => e.WorkOrderFinalId == constructSolution.WorkOrderFinalId);
|
|
if (newConstructSolution == null)
|
|
{
|
|
AddWorkOrder(constructSolution);
|
|
}
|
|
else
|
|
{
|
|
|
|
newConstructSolution.ProjectId = constructSolution.ProjectId;
|
|
newConstructSolution.UnitId = constructSolution.UnitId;
|
|
newConstructSolution.CompileMan = constructSolution.CompileMan;
|
|
newConstructSolution.State = constructSolution.State;
|
|
newConstructSolution.CompileDate = constructSolution.CompileDate;
|
|
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 把状态转换代号为文字形式
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
///
|
|
public static string ConvertState(object state)
|
|
{
|
|
if (state != null)
|
|
{
|
|
if (state.ToString() == BLL.Const.CQMSConstructSolution_ReCompile)
|
|
{
|
|
return "重报";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Compile)
|
|
{
|
|
return "编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Audit)
|
|
{
|
|
return "会签";
|
|
}
|
|
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Complete)
|
|
{
|
|
return "审批完成";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据方案审查Id获取一个方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolutionCode">方案审查Id</param>
|
|
/// <returns>一个方案审查实体</returns>
|
|
public static Model.CQMS_WorkOrder_Final GetWorkOrderById(string WorkOrderFinalId)
|
|
{
|
|
return Funs.DB.CQMS_WorkOrder_Final.FirstOrDefault(x => x.WorkOrderFinalId == WorkOrderFinalId);
|
|
}
|
|
|
|
|
|
}
|
|
}
|