117 lines
4.4 KiB
C#
117 lines
4.4 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 VisaApplicationFinalService
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 根据方案审查Id删除一个方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolutionCode">方案审查Id</param>
|
|
public static void DeleteVisaApplication(string visaApplicationFinalId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_VisaApplication_Final visaApplication_Final = db.CQMS_VisaApplication_Final.First(e => e.VisaApplicationFinalId == visaApplicationFinalId);
|
|
|
|
db.CQMS_VisaApplication_Final.DeleteOnSubmit(visaApplication_Final);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void AddVisaApplication(Model.CQMS_VisaApplication_Final constructSolution)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_VisaApplication_Final newConstructSolution = new Model.CQMS_VisaApplication_Final();
|
|
newConstructSolution.VisaApplicationFinalId = constructSolution.VisaApplicationFinalId;
|
|
newConstructSolution.ProjectId = constructSolution.ProjectId;
|
|
newConstructSolution.UnitId = constructSolution.UnitId;
|
|
newConstructSolution.CompileMan = constructSolution.CompileMan;
|
|
newConstructSolution.State = constructSolution.State;
|
|
newConstructSolution.CompileDate = constructSolution.CompileDate;
|
|
|
|
db.CQMS_VisaApplication_Final.InsertOnSubmit(newConstructSolution);
|
|
db.SubmitChanges();
|
|
}
|
|
/// <summary>
|
|
/// 修改方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void UpdateVisaApplication(Model.CQMS_VisaApplication_Final constructSolution)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.CQMS_VisaApplication_Final newConstructSolution = db.CQMS_VisaApplication_Final.FirstOrDefault(e => e.VisaApplicationFinalId == constructSolution.VisaApplicationFinalId);
|
|
if (newConstructSolution == null)
|
|
{
|
|
AddVisaApplication(constructSolution);
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
newConstructSolution.VisaApplicationFinalId = constructSolution.VisaApplicationFinalId;
|
|
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_VisaApplication_Final GetVisaApplicationById(string VisaApplicationFinalId)
|
|
{
|
|
return Funs.DB.CQMS_VisaApplication_Final.FirstOrDefault(x => x.VisaApplicationFinalId == VisaApplicationFinalId);
|
|
}
|
|
|
|
|
|
}
|
|
}
|