internal void AddCustomerContacts(T_Customer_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.T_Customer_contacts.Add(contact); db.SaveChanges(); } }
public void AddCustomerContact(T_Customer_contacts contacts) { try { ch = new CustomerHelper(); ch.AddCustomerContacts(contacts); } catch (Exception ex) { throw ex; } }
internal void DelCustomerContacts(T_Customer_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.Entry(contact).State = EntityState.Deleted; db.SaveChanges(); } }
private void btn_contactadd_Click(object sender, EventArgs e) { try { var ds = (List<T_Customer_contacts>)this.gvcontacts.DataSource; var newcontact = new T_Customer_contacts(); newcontact.customerid = m_cid; modifycontactlst.Add(newcontact); ds.Insert(0, newcontact); gvcontacts.RefreshData(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } }