예제 #1
0
        internal void AddCustomerContacts(T_Customer_contacts contact)
        {
            using (MEMSContext db = new MEMSContext())
            {
                db.T_Customer_contacts.Add(contact);

                db.SaveChanges();
            }
        }
예제 #2
0
 public void AddCustomerContact(T_Customer_contacts contacts)
 {
     try
     {
         ch = new CustomerHelper();
         ch.AddCustomerContacts(contacts);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 internal void DelCustomerContacts(T_Customer_contacts contact)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(contact).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
예제 #4
0
 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);
     }
 }