public void Update(TBL_SUPPLIERS supplier) { var obj = Context.TBL_SUPPLIERS.Where(p => p.SupplierId == supplier.SupplierId).FirstOrDefault(); obj.Name = supplier.Name; obj.PhoneNumber = supplier.PhoneNumber; obj.ContactName = supplier.ContactName; obj.ContactTitle = supplier.ContactTitle; obj.ContactPhone = supplier.ContactPhone; obj.Description = supplier.Description; obj.Email = supplier.Email; obj.SupplierId = supplier.SupplierId; obj.SupplierType = supplier.SupplierType; obj.WebPage = supplier.WebPage; obj.City = supplier.City; obj.Address = supplier.Address; Context.SaveChanges(); }
public void Add(TBL_SUPPLIERS supplier) { Context.TBL_SUPPLIERS.Add(supplier); Context.SaveChanges(); }