2022-09-05 16:36:31 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 合同基本信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class ContractService
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据主键获取合同基本信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="contractId"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static Model.PHTGL_Contract GetContractById(string contractId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Funs.DB.PHTGL_Contract.FirstOrDefault(e => e.ContractId == contractId);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据总包合同编号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ProjectId"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static Model.PHTGL_Contract GetContractByProjectId(string ProjectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Funs.DB.PHTGL_Contract.FirstOrDefault(e => e.ProjectId == ProjectId);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据合同编号
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ContractNum"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static Model.PHTGL_Contract GetContractByContractNum(string ContractNum)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Funs.DB.PHTGL_Contract.FirstOrDefault(e => e.ContractNum == ContractNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static List<Model.Base_Project> GetProjectDropDownList()
|
|
|
|
|
|
{
|
|
|
|
|
|
var list = (from x in Funs.DB.PHTGL_Contract
|
|
|
|
|
|
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
|
|
|
|
|
where x.ApproveState > 0
|
|
|
|
|
|
select y).ToList();
|
|
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void InitAllProjectCodeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
|
|
|
|
|
{
|
|
|
|
|
|
dropName.DataValueField = "ProjectId";
|
|
|
|
|
|
dropName.DataTextField = "ProjectCode";
|
|
|
|
|
|
var projectlist = BLL.ContractService.GetProjectDropDownList();
|
|
|
|
|
|
dropName.DataSource = projectlist;
|
|
|
|
|
|
dropName.DataBind();
|
|
|
|
|
|
if (projectlist.Count() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
isShowPlease = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (isShowPlease)
|
|
|
|
|
|
{
|
|
|
|
|
|
Funs.FineUIPleaseSelect(dropName);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 增加合同基本信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="contract"></param>
|
2022-09-08 20:14:51 +08:00
|
|
|
|
public static void AddContract(Model.PHTGL_Contract newtable)
|
2022-09-05 16:36:31 +08:00
|
|
|
|
{
|
2022-09-08 20:14:51 +08:00
|
|
|
|
Model.PHTGL_Contract table = new Model.PHTGL_Contract
|
|
|
|
|
|
{
|
|
|
|
|
|
ContractId = newtable.ContractId,
|
|
|
|
|
|
ProjectId = newtable.ProjectId,
|
|
|
|
|
|
ContractName = newtable.ContractName,
|
|
|
|
|
|
ContractNum = newtable.ContractNum,
|
|
|
|
|
|
Parties = newtable.Parties,
|
|
|
|
|
|
Currency = newtable.Currency,
|
|
|
|
|
|
ContractAmount = newtable.ContractAmount,
|
|
|
|
|
|
DepartId = newtable.DepartId,
|
|
|
|
|
|
Agent = newtable.Agent,
|
|
|
|
|
|
ContractType = newtable.ContractType,
|
|
|
|
|
|
Remarks = newtable.Remarks,
|
|
|
|
|
|
ApproveState = newtable.ApproveState,
|
|
|
|
|
|
CreatUser = newtable.CreatUser,
|
|
|
|
|
|
ContractCode = newtable.ContractCode,
|
|
|
|
|
|
IsPassBid = newtable.IsPassBid,
|
|
|
|
|
|
PassBidCode = newtable.PassBidCode,
|
|
|
|
|
|
BuildUnit = newtable.BuildUnit,
|
|
|
|
|
|
IsUseStandardtxt = newtable.IsUseStandardtxt,
|
|
|
|
|
|
NoUseStandardtxtRemark = newtable.NoUseStandardtxtRemark,
|
|
|
|
|
|
EPCCode = newtable.EPCCode,
|
|
|
|
|
|
ProjectShortName = newtable.ProjectShortName,
|
|
|
|
|
|
ContractAttribute = newtable.ContractAttribute,
|
|
|
|
|
|
ContractAttributeRemark = newtable.ContractAttributeRemark,
|
|
|
|
|
|
ConfirmWay = newtable.ConfirmWay,
|
|
|
|
|
|
SetSubReviewCode = newtable.SetSubReviewCode,
|
|
|
|
|
|
ActionPlanCode = newtable.ActionPlanCode,
|
|
|
|
|
|
SituationRemark = newtable.SituationRemark,
|
|
|
|
|
|
OpeningBank_TT = newtable.OpeningBank_TT,
|
|
|
|
|
|
OpeningBank_Electrophore = newtable.OpeningBank_Electrophore,
|
|
|
|
|
|
BankAccount_TT = newtable.BankAccount_TT,
|
|
|
|
|
|
BankAccount_Electrophore = newtable.BankAccount_Electrophore,
|
|
|
|
|
|
LineNumber_Electrophore = newtable.LineNumber_Electrophore,
|
|
|
|
|
|
Retentionmoney = newtable.Retentionmoney,
|
|
|
|
|
|
CreateDate = newtable.CreateDate,
|
|
|
|
|
|
Status = newtable.Status,
|
|
|
|
|
|
ContactPersonOfPartyA = newtable.ContactPersonOfPartyA,
|
|
|
|
|
|
ContactPersonOfPartyB = newtable.ContactPersonOfPartyB,
|
|
|
|
|
|
ContactPersonPhoneOfPartyB = newtable.ContactPersonPhoneOfPartyB,
|
|
|
|
|
|
ContactPersonEmailOfPartyB = newtable.ContactPersonEmailOfPartyB,
|
|
|
|
|
|
ContractAmountExcludingTax = newtable.ContractAmountExcludingTax,
|
|
|
|
|
|
PriceMethod = newtable.PriceMethod,
|
|
|
|
|
|
SignedOnDate = newtable.SignedOnDate,
|
|
|
|
|
|
ContractStartDate = newtable.ContractStartDate,
|
|
|
|
|
|
ContractEndDate = newtable.ContractEndDate,
|
|
|
|
|
|
PricingBasis = newtable.PricingBasis,
|
|
|
|
|
|
SubcontractingMethod = newtable.SubcontractingMethod,
|
|
|
|
|
|
IsItACentralizedPurchaseSupplier = newtable.IsItACentralizedPurchaseSupplier,
|
|
|
|
|
|
ContactUnitOfPartyA = newtable.ContactUnitOfPartyA,
|
2022-09-13 10:58:05 +08:00
|
|
|
|
Clause = newtable.Clause,
|
|
|
|
|
|
MainContent = newtable.MainContent,
|
2022-09-08 20:14:51 +08:00
|
|
|
|
};
|
|
|
|
|
|
Funs.DB.PHTGL_Contract.InsertOnSubmit(table);
|
2022-09-05 16:36:31 +08:00
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 修改合同基本信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="contract"></param>
|
|
|
|
|
|
public static void UpdateContract(Model.PHTGL_Contract contract)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.PHTGL_Contract newContract = Funs.DB.PHTGL_Contract.FirstOrDefault(e => e.ContractId == contract.ContractId);
|
|
|
|
|
|
if (newContract != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
newContract.ProjectId = contract.ProjectId;
|
|
|
|
|
|
newContract.ContractCode = contract.ContractCode;
|
|
|
|
|
|
newContract.ContractName = contract.ContractName;
|
|
|
|
|
|
newContract.ContractNum = contract.ContractNum;
|
|
|
|
|
|
newContract.Parties = contract.Parties;
|
|
|
|
|
|
newContract.Currency = contract.Currency;
|
|
|
|
|
|
newContract.ContractAmount = contract.ContractAmount;
|
|
|
|
|
|
newContract.DepartId = contract.DepartId;
|
|
|
|
|
|
newContract.Agent = contract.Agent;
|
|
|
|
|
|
newContract.ContractType = contract.ContractType;
|
|
|
|
|
|
newContract.Remarks = contract.Remarks;
|
|
|
|
|
|
newContract.ApproveState = contract.ApproveState;
|
|
|
|
|
|
newContract.CreatUser = contract.CreatUser;
|
|
|
|
|
|
newContract.IsPassBid = contract.IsPassBid;
|
|
|
|
|
|
newContract.PassBidCode = contract.PassBidCode;
|
|
|
|
|
|
newContract.BuildUnit = contract.BuildUnit;
|
|
|
|
|
|
newContract.EPCCode = contract.EPCCode;
|
|
|
|
|
|
newContract.IsUseStandardtxt = contract.IsUseStandardtxt;
|
|
|
|
|
|
newContract.NoUseStandardtxtRemark = contract.NoUseStandardtxtRemark;
|
|
|
|
|
|
newContract.ProjectShortName = contract.ProjectShortName;
|
|
|
|
|
|
newContract.ContractAttribute = contract.ContractAttribute;
|
|
|
|
|
|
newContract.ContractAttributeRemark = contract.ContractAttributeRemark;
|
|
|
|
|
|
newContract.ConfirmWay = contract.ConfirmWay;
|
|
|
|
|
|
newContract.SetSubReviewCode = contract.SetSubReviewCode;
|
|
|
|
|
|
newContract.ActionPlanCode = contract.ActionPlanCode;
|
|
|
|
|
|
newContract.SituationRemark = contract.SituationRemark;
|
|
|
|
|
|
newContract.OpeningBank_TT = contract.OpeningBank_TT;
|
|
|
|
|
|
newContract.OpeningBank_Electrophore = contract.OpeningBank_Electrophore;
|
|
|
|
|
|
newContract.BankAccount_TT = contract.BankAccount_TT;
|
|
|
|
|
|
newContract.BankAccount_Electrophore = contract.BankAccount_Electrophore;
|
|
|
|
|
|
newContract.LineNumber_Electrophore = contract.LineNumber_Electrophore;
|
|
|
|
|
|
newContract.Retentionmoney = contract.Retentionmoney;
|
|
|
|
|
|
newContract.CreateDate = contract.CreateDate;
|
2022-09-08 20:14:51 +08:00
|
|
|
|
newContract.Status = contract.Status;
|
|
|
|
|
|
newContract.ContactPersonOfPartyA = contract.ContactPersonOfPartyA;
|
|
|
|
|
|
newContract.ContactPersonOfPartyB = contract.ContactPersonOfPartyB;
|
|
|
|
|
|
newContract.ContactPersonPhoneOfPartyB = contract.ContactPersonPhoneOfPartyB;
|
|
|
|
|
|
newContract.ContactPersonEmailOfPartyB = contract.ContactPersonEmailOfPartyB;
|
|
|
|
|
|
newContract.ContractAmountExcludingTax = contract.ContractAmountExcludingTax;
|
|
|
|
|
|
newContract.PriceMethod = contract.PriceMethod;
|
|
|
|
|
|
newContract.SignedOnDate = contract.SignedOnDate;
|
|
|
|
|
|
newContract.ContractStartDate = contract.ContractStartDate;
|
|
|
|
|
|
newContract.ContractEndDate = contract.ContractEndDate;
|
|
|
|
|
|
newContract.PricingBasis = contract.PricingBasis;
|
|
|
|
|
|
newContract.SubcontractingMethod = contract.SubcontractingMethod;
|
|
|
|
|
|
newContract.IsItACentralizedPurchaseSupplier = contract.IsItACentralizedPurchaseSupplier;
|
|
|
|
|
|
newContract.ContactUnitOfPartyA = contract.ContactUnitOfPartyA;
|
2022-09-13 10:58:05 +08:00
|
|
|
|
newContract.Clause = contract.Clause;
|
|
|
|
|
|
newContract.MainContent = contract.MainContent;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据主键删除合同基本信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="contractId"></param>
|
|
|
|
|
|
public static void DeleteContractById(string contractId)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
Model.PHTGL_Contract contract = Funs.DB.PHTGL_Contract.FirstOrDefault(e => e.ContractId == contractId);
|
|
|
|
|
|
if (contract != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Funs.DB.PHTGL_Contract.DeleteOnSubmit(contract);
|
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|