using System.Linq; namespace BLL { /// /// 附件2 合同价格及支付办法 /// public static class AttachUrl2Service { /// /// 根据附件Id获取附件2信息 /// /// /// public static Model.PHTGL_AttachUrl2 GetAttachUrlByAttachUrlId(string attachUrlId) { return Funs.DB.PHTGL_AttachUrl2.FirstOrDefault(e => e.AttachUrlId == attachUrlId); } /// /// 增加附件2 /// /// public static void AddAttachUrl2(Model.PHTGL_AttachUrl2 att) { Model.PHTGL_AttachUrl2 newAtt = new Model.PHTGL_AttachUrl2(); newAtt.AttachUrlItemId = att.AttachUrlItemId; newAtt.AttachUrlId = att.AttachUrlId; newAtt.ContractPrice = att.ContractPrice; newAtt.ComprehensiveUnitPrice = att.ComprehensiveUnitPrice; newAtt.ComprehensiveRate1 = att.ComprehensiveRate1; newAtt.ComprehensiveRate2 = att.ComprehensiveRate2; newAtt.ComprehensiveRate3 = att.ComprehensiveRate3; newAtt.ComprehensiveRate4 = att.ComprehensiveRate4; newAtt.ComprehensiveRate5 = att.ComprehensiveRate5; newAtt.TotalPriceDown1 = att.TotalPriceDown1; newAtt.TotalPriceDown2 = att.TotalPriceDown2; newAtt.TotalPriceDown3 = att.TotalPriceDown3; newAtt.TotalPriceDown4 = att.TotalPriceDown4; newAtt.TotalPriceDown5 = att.TotalPriceDown5; newAtt.TechnicalWork = att.TechnicalWork; newAtt.PhysicalLaborer = att.PhysicalLaborer; newAtt.TestCar1 = att.TestCar1; newAtt.TestCar2 = att.TestCar2; newAtt.PayWay = att.PayWay; newAtt.PayMethod = att.PayMethod; newAtt.AttachUrlContent = att.AttachUrlContent; Funs.DB.PHTGL_AttachUrl2.InsertOnSubmit(newAtt); Funs.DB.SubmitChanges(); } /// /// 修改附件2 /// /// public static void UpdateAttachUrl2(Model.PHTGL_AttachUrl2 att) { Model.PHTGL_AttachUrl2 newAtt = Funs.DB.PHTGL_AttachUrl2.FirstOrDefault(e => e.AttachUrlId == att.AttachUrlId); if (newAtt != null) { newAtt.ContractPrice = att.ContractPrice; newAtt.ComprehensiveUnitPrice = att.ComprehensiveUnitPrice; newAtt.ComprehensiveRate1 = att.ComprehensiveRate1; newAtt.ComprehensiveRate2 = att.ComprehensiveRate2; newAtt.ComprehensiveRate3 = att.ComprehensiveRate3; newAtt.ComprehensiveRate4 = att.ComprehensiveRate4; newAtt.ComprehensiveRate5 = att.ComprehensiveRate5; newAtt.TotalPriceDown1 = att.TotalPriceDown1; newAtt.TotalPriceDown2 = att.TotalPriceDown2; newAtt.TotalPriceDown3 = att.TotalPriceDown3; newAtt.TotalPriceDown4 = att.TotalPriceDown4; newAtt.TotalPriceDown5 = att.TotalPriceDown5; newAtt.TechnicalWork = att.TechnicalWork; newAtt.PhysicalLaborer = att.PhysicalLaborer; newAtt.TestCar1 = att.TestCar1; newAtt.TestCar2 = att.TestCar2; newAtt.PayWay = att.PayWay; newAtt.PayMethod = att.PayMethod; newAtt.AttachUrlContent = att.AttachUrlContent; Funs.DB.SubmitChanges(); } } } }