internal void DelSupplierContacts(T_Suppliers_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.Entry(contact).State = EntityState.Deleted; db.SaveChanges(); } }
internal void AddSupplierContacts(T_Suppliers_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.T_Suppliers_contacts.Add(contact); db.SaveChanges(); } }
public void EditSupplierContacts(T_Suppliers_contacts contact) { try { sh = new SupplierHelper(); sh.UpdateSupplierContacts(contact); } catch (Exception ex) { throw ex; } }
private void btn_contactadd_Click(object sender, EventArgs e) { var ds = (List<T_Suppliers_contacts>)this.gvContact.DataSource; var newcontact = new T_Suppliers_contacts(); newcontact.supplierid = m_supplierid; modifycontactlst.Add(newcontact); ds.Insert(0, newcontact); gvContact.RefreshData(); }