/* * Company orders */ public CreateInvoice(List <T> input, Interface.IcompanyCustomer customer, Interface.IbankAccounts bank, Interface.Idepartment dep, int daysToPay, string fakturaNo) { this.orders = input; if (!(input is List <Interface.IcompanyOrder>)) { throw new ArgumentException("Not of right type"); } this.companyCustomer = customer; this.bank = bank; this.daysToPay = daysToPay; this.fakturaNo = "C-" + fakturaNo; this.dep = dep; }
public void Update(Interface.Idepartment department) { using (LMCdatabaseDataContext dbContext = new LMCdatabaseDataContext(this.connectionString)) { tblDepartment updateDepartment = dbContext.tblDepartments.SingleOrDefault( x => x.department == department.Deparment); updateDepartment._address = department.Address; updateDepartment.active = department.Active; updateDepartment.altPhoneNo = department.AltPhoneNo; updateDepartment.companyName = department.CompanyName; updateDepartment.cvrNo = department.CvrNo; updateDepartment.department = department.Deparment; updateDepartment.departmentHeadNo = department.DeparmentHead.WorkNo; updateDepartment.email = department.Email; updateDepartment.phoneNo = department.PhoneNo; updateDepartment.postNo = department.PostNo.Id; dbContext.SubmitChanges(); } }
public void Add(Interface.Idepartment department) { using (LMCdatabaseDataContext dbContext = new LMCdatabaseDataContext(this.connectionString)) { tblDepartment newDepartment = new tblDepartment { _address = department.Address, active = department.Active, altPhoneNo = department.AltPhoneNo, companyName = department.CompanyName, cvrNo = department.CvrNo, department = department.Deparment, departmentHeadNo = department.DeparmentHead.WorkNo, email = department.Email, phoneNo = department.PhoneNo, postNo = department.PostNo.Id }; dbContext.tblDepartments.InsertOnSubmit(newDepartment); dbContext.SubmitChanges(); } }