122 lines
5.6 KiB
C#
122 lines
5.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
public class ContractManagementService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取Contract Management
|
|
/// </summary>
|
|
/// <param name="contractManagementId"></param>
|
|
/// <returns></returns>
|
|
public static Model.FC_ContractManagement GetContractManagementById(string fileId)
|
|
{
|
|
return Funs.DB.FC_ContractManagement.FirstOrDefault(e => e.FileId == fileId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加Contract Management
|
|
/// </summary>
|
|
/// <param name="contractManagement"></param>
|
|
public static void AddContractManagement(Model.FC_ContractManagement contractManagement)
|
|
{
|
|
Model.FC_ContractManagement newContractManagement = new Model.FC_ContractManagement();
|
|
newContractManagement.FileId = contractManagement.FileId;
|
|
newContractManagement.FC_ID = contractManagement.FC_ID;
|
|
newContractManagement.FileName = contractManagement.FileName;
|
|
newContractManagement.FileTypeId = contractManagement.FileTypeId;
|
|
newContractManagement.BycDept = contractManagement.BycDept;
|
|
//newContractManagement.FileTypeCode = contractManagement.FileTypeCode;
|
|
newContractManagement.OccurDate = contractManagement.OccurDate;
|
|
newContractManagement.UploadMan = contractManagement.UploadMan;
|
|
newContractManagement.UploadDate = contractManagement.UploadDate;
|
|
newContractManagement.Remark = contractManagement.Remark;
|
|
newContractManagement.AttachUrl = contractManagement.AttachUrl;
|
|
newContractManagement.SupplementedBudget = contractManagement.SupplementedBudget;
|
|
newContractManagement.TotalBudget = contractManagement.TotalBudget;
|
|
newContractManagement.StartDate = contractManagement.StartDate;
|
|
newContractManagement.EndDate = contractManagement.EndDate;
|
|
newContractManagement.AuditDate = contractManagement.AuditDate;
|
|
newContractManagement.AuditResult = contractManagement.AuditResult;
|
|
Funs.DB.FC_ContractManagement.InsertOnSubmit(newContractManagement);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改Contract Management
|
|
/// </summary>
|
|
/// <param name="contractManagement"></param>
|
|
public static void UpdateContractManagement(Model.FC_ContractManagement contractManagement)
|
|
{
|
|
Model.FC_ContractManagement newContractManagement = Funs.DB.FC_ContractManagement.FirstOrDefault(e => e.FileId == contractManagement.FileId);
|
|
if (newContractManagement != null)
|
|
{
|
|
newContractManagement.FileName = contractManagement.FileName;
|
|
newContractManagement.FileTypeId = contractManagement.FileTypeId;
|
|
newContractManagement.BycDept = contractManagement.BycDept;
|
|
//newContractManagement.FileTypeCode = contractManagement.FileTypeCode;
|
|
newContractManagement.OccurDate = contractManagement.OccurDate;
|
|
newContractManagement.UploadMan = contractManagement.UploadMan;
|
|
newContractManagement.UploadDate = contractManagement.UploadDate;
|
|
newContractManagement.Remark = contractManagement.Remark;
|
|
newContractManagement.AttachUrl = contractManagement.AttachUrl;
|
|
newContractManagement.SupplementedBudget = contractManagement.SupplementedBudget;
|
|
newContractManagement.TotalBudget = contractManagement.TotalBudget;
|
|
newContractManagement.StartDate = contractManagement.StartDate;
|
|
newContractManagement.EndDate = contractManagement.EndDate;
|
|
newContractManagement.AuditDate = contractManagement.AuditDate;
|
|
newContractManagement.AuditResult = contractManagement.AuditResult;
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除Contract Management
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
public static void DeleteContractManagementById(string id)
|
|
{
|
|
Model.FC_ContractManagement con = Funs.DB.FC_ContractManagement.FirstOrDefault(e => e.FileId == id);
|
|
if (con != null)
|
|
{
|
|
Funs.DB.FC_ContractManagement.DeleteOnSubmit(con);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="rowID"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.FC_ContractManagement> GetContractManagementByDataId(string dataId)
|
|
{
|
|
return (from x in Funs.DB.FC_ContractManagement where x.FC_ID == Convert.ToInt32(dataId) select x).ToList();
|
|
}
|
|
|
|
|
|
public static List<Model.FC_ContractManagement> GetContractManagementByDataIdFileType(string dataId, string fileTypeId)
|
|
{
|
|
return (from x in Funs.DB.FC_ContractManagement where x.FC_ID == Convert.ToInt32(dataId) && x.FileTypeId == fileTypeId select x).ToList();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据合同主键删除所有相关附件信息
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
public static void DeleteContractManagementByDataId(string dataId)
|
|
{
|
|
var q = (from x in Funs.DB.FC_ContractManagement where x.FC_ID == Convert.ToInt32(dataId) select x).ToList();
|
|
if (q != null)
|
|
{
|
|
Funs.DB.FC_ContractManagement.DeleteAllOnSubmit(q);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|