//modify in 3/11 public void selectAddNewSupplier(string supplierId, string supplierName, string contact, string phone, string fax, string Address) { supplier s = new supplier(); s.address = Address; s.contactName = contact; s.name = supplierName; s.supplierId = supplierId; s.phoneNo = Convert.ToDecimal(phone); s.faxNo = Convert.ToDecimal(fax); s.status = "Active"; supplierFacade.createSupplier_Lingna(s); List<item> items = catalogueFacade.getItems_Lingna(); foreach (item i in items) { supplierPrice sp = new supplierPrice(); sp.supplierId = supplierId; sp.itemId = i.itemId; sp.price = 0; supplierFacade.createSupplierPrice_Lingna(sp); } }
//modify in 3/11 public void createSupplierPrice_Lingna(supplierPrice s) { ctx.supplierPrices.Add(s); ctx.SaveChanges(); }
public void updateSupplierPrice_Lingna(supplierPrice sp) { ctx.Entry(sp).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); }