예제 #1
0
 public static void SaveCustomerMaster(MasterCustomer objMasterCustomer)
 {
     using (var dbInvoice = new IncubXpertInvoicingDb())
     {
         dbInvoice.MasterCustomers.AddOrUpdate(objMasterCustomer);
         dbInvoice.SaveChanges();
     }
 }
예제 #2
0
 public static void DeleteCustomer(int Id)
 {
     using (var dbInvoice = new IncubXpertInvoicingDb())
     {
         var query = from s in dbInvoice.MasterCustomers
                     where s.Id == Id
                     select s;
         var result = query.FirstOrDefault();
         if (result != null)
         {
             dbInvoice.MasterCustomers.Remove(result);
             dbInvoice.SaveChanges();
         }
     }
 }