115 lines
4.3 KiB
C#
115 lines
4.3 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.CQMS.Comprehensive
|
|
{
|
|
public class ContactListService
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
/// 根据方案审查Id删除一个方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolutionCode">方案审查Id</param>
|
|
public static void DeletetContactList(string ContactListId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Comprehensive_ContactList visaApplication_Final = db.Comprehensive_ContactList.First(e => e.ContactListId == ContactListId);
|
|
|
|
db.Comprehensive_ContactList.DeleteOnSubmit(visaApplication_Final);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void AddtContactList(Model.Comprehensive_ContactList contactList)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Comprehensive_ContactList newContactList = new Model.Comprehensive_ContactList();
|
|
newContactList.ContactListId = contactList.ContactListId;
|
|
newContactList.ProjectId = contactList.ProjectId;
|
|
newContactList.UnitId = contactList.UnitId;
|
|
newContactList.CreateMan = contactList.CreateMan;
|
|
newContactList.Remark = contactList.Remark;
|
|
newContactList.CreateDate = contactList.CreateDate;
|
|
newContactList.CNProfessionalId = contactList.CNProfessionalId;
|
|
newContactList.ContactListCode = contactList.ContactListCode;
|
|
db.Comprehensive_ContactList.InsertOnSubmit(newContactList);
|
|
db.SubmitChanges();
|
|
}
|
|
/// <summary>
|
|
/// 修改方案审查信息
|
|
/// </summary>
|
|
/// <param name="constructSolution">方案审查实体</param>
|
|
public static void UpdatetContactList(Model.Comprehensive_ContactList contactList)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Comprehensive_ContactList newContactList = db.Comprehensive_ContactList.FirstOrDefault(e => e.ContactListId == contactList.ContactListId);
|
|
if (newContactList == null)
|
|
{
|
|
AddtContactList(contactList);
|
|
}
|
|
else
|
|
{ newContactList.ProjectId = contactList.ProjectId;
|
|
newContactList.UnitId = contactList.UnitId;
|
|
newContactList.CreateMan = contactList.CreateMan;
|
|
newContactList.Remark = contactList.Remark;
|
|
newContactList.CreateDate = contactList.CreateDate;
|
|
newContactList.CNProfessionalId = contactList.CNProfessionalId;
|
|
newContactList.ContactListCode = contactList.ContactListCode;
|
|
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.Comprehensive_ContactList GetContactListById(string ContactListId)
|
|
{
|
|
return Funs.DB.Comprehensive_ContactList.FirstOrDefault(x => x.ContactListId == ContactListId);
|
|
}
|
|
|
|
}
|
|
|
|
}
|