119 lines
5.3 KiB
C#
119 lines
5.3 KiB
C#
|
using Model;
|
|||
|
using System;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace BLL
|
|||
|
{
|
|||
|
public class SESReportToCPTService
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 根据主键获取数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="id"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static Model.FC_SESReportToCPT GetSESReportToCPTById(string id)
|
|||
|
{
|
|||
|
return Funs.DB.FC_SESReportToCPT.FirstOrDefault(e => e.ID == Convert.ToInt32(id));
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 增加
|
|||
|
/// </summary>
|
|||
|
/// <param name="sesReport"></param>
|
|||
|
public static void AddSESReportToCPT(Model.FC_SESReportToCPT sesReport)
|
|||
|
{
|
|||
|
Model.FC_SESReportToCPT newSESReport = new Model.FC_SESReportToCPT();
|
|||
|
newSESReport.ID = sesReport.ID;
|
|||
|
newSESReport.SES_No = sesReport.SES_No;
|
|||
|
newSESReport.Short_Descrption = sesReport.Short_Descrption;
|
|||
|
newSESReport.Start_Date = sesReport.Start_Date;
|
|||
|
newSESReport.End_Date = sesReport.End_Date;
|
|||
|
newSESReport.Created_by = sesReport.Created_by;
|
|||
|
newSESReport.Created_on = sesReport.Created_on;
|
|||
|
newSESReport.TECO_Date = sesReport.TECO_Date;
|
|||
|
newSESReport.TECO_Format = sesReport.TECO_Format;
|
|||
|
newSESReport.Requisitioner = sesReport.Requisitioner;
|
|||
|
newSESReport.FO = sesReport.FO;
|
|||
|
newSESReport.Item = sesReport.Item;
|
|||
|
newSESReport.Vendor_Name = sesReport.Vendor_Name;
|
|||
|
newSESReport.Discipline = sesReport.Discipline;
|
|||
|
newSESReport.SSR_budget = sesReport.SSR_budget;
|
|||
|
newSESReport.Currency = sesReport.Currency;
|
|||
|
newSESReport.Contractor_quotation = sesReport.Contractor_quotation;
|
|||
|
newSESReport.SSR_Actual_cost = sesReport.SSR_Actual_cost;
|
|||
|
newSESReport.Cost_checker = sesReport.Cost_checker;
|
|||
|
newSESReport.Tax_rate = sesReport.Tax_rate;
|
|||
|
newSESReport.Changed_by = sesReport.Changed_by;
|
|||
|
newSESReport.Deviation = sesReport.Deviation;
|
|||
|
newSESReport.Deviation_Percentage = sesReport.Deviation_Percentage;
|
|||
|
newSESReport.Overrun = sesReport.Overrun;
|
|||
|
newSESReport.Long_text = sesReport.Long_text;
|
|||
|
newSESReport.Work_Order = sesReport.Work_Order;
|
|||
|
newSESReport.Function_location = sesReport.Function_location;
|
|||
|
newSESReport.Main_work_center = sesReport.Main_work_center;
|
|||
|
newSESReport.Work_Center = sesReport.Work_Center;
|
|||
|
newSESReport.Dep = sesReport.Dep;
|
|||
|
newSESReport.Section = sesReport.Section;
|
|||
|
newSESReport.Cost_center = sesReport.Cost_center;
|
|||
|
newSESReport.WBS = sesReport.WBS;
|
|||
|
newSESReport.Network = sesReport.Network;
|
|||
|
newSESReport.TODAY = sesReport.TODAY;
|
|||
|
newSESReport.Claim_sheets_receive = sesReport.Claim_sheets_receive;
|
|||
|
newSESReport.CS_REC_Format = sesReport.CS_REC_Format;
|
|||
|
newSESReport.No_SUBM_To_today = sesReport.No_SUBM_To_today;
|
|||
|
newSESReport.Contractor_duration = sesReport.Contractor_duration;
|
|||
|
newSESReport.Engineer_confirmed_o = sesReport.Engineer_confirmed_o;
|
|||
|
newSESReport.ENG_CONF_Format = sesReport.ENG_CONF_Format;
|
|||
|
newSESReport.No_BoQ_CONF_to_today = sesReport.No_BoQ_CONF_to_today;
|
|||
|
newSESReport.BoQ_confirmation_dur = sesReport.BoQ_confirmation_dur;
|
|||
|
newSESReport.SES_Confirmed_on = sesReport.SES_Confirmed_on;
|
|||
|
newSESReport.SES_CONF_Format = sesReport.SES_CONF_Format;
|
|||
|
newSESReport.No_SES_to_today = sesReport.No_SES_to_today;
|
|||
|
newSESReport.Settlement_duration = sesReport.Settlement_duration;
|
|||
|
newSESReport.Invoiced_on = sesReport.Invoiced_on;
|
|||
|
newSESReport.Invoice_duration = sesReport.Invoice_duration;
|
|||
|
newSESReport.Payment_made_on = sesReport.Payment_made_on;
|
|||
|
newSESReport.Payment_duration = sesReport.Payment_duration;
|
|||
|
newSESReport.DateIn = sesReport.DateIn;
|
|||
|
newSESReport.Remark1 = sesReport.Remark1;
|
|||
|
newSESReport.Remark2 = sesReport.Remark2;
|
|||
|
newSESReport.Accepted = sesReport.Accepted;
|
|||
|
newSESReport.Deleted = sesReport.Deleted;
|
|||
|
newSESReport.Blocked = sesReport.Blocked;
|
|||
|
Funs.DB.FC_SESReportToCPT.InsertOnSubmit(newSESReport);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 根据主键删除数据
|
|||
|
/// </summary>
|
|||
|
/// <param name="id"></param>
|
|||
|
public static void DeleteSESReportToCPTById(string id)
|
|||
|
{
|
|||
|
Model.FC_SESReportToCPT SESReport = Funs.DB.FC_SESReportToCPT.FirstOrDefault(e => e.ID == Convert.ToInt32(id));
|
|||
|
if (SESReport != null)
|
|||
|
{
|
|||
|
Funs.DB.FC_SESReportToCPT.DeleteOnSubmit(SESReport);
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 判断SES_NO是否存在
|
|||
|
/// </summary>
|
|||
|
/// <param name="id"></param>
|
|||
|
/// <param name="SES_No"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool IsExistSES_No(string SES_No)
|
|||
|
{
|
|||
|
bool isExist = false;
|
|||
|
var fono = Funs.DB.FC_SESReportToCPT.FirstOrDefault(x => x.SES_No == SES_No);
|
|||
|
if (fono != null)
|
|||
|
{
|
|||
|
isExist = true;
|
|||
|
}
|
|||
|
return isExist;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|