Example #1
0
 public bool AddBilling(Billing model)
 {
     try
     {
         entities.Billings.Add(model);
         entities.SaveChanges();
         return true;
     }
     catch (Exception x)
     {
         throw x;
     }
 }
Example #2
0
 public bool UpdateBilling(Billing model)
 {
     try
     {
         Billing billing = entities.Billings.Where(x => x.BillingId == model.BillingId).SingleOrDefault();
         if (billing != null)
         {
             entities.Entry(billing).CurrentValues.SetValues(model);
             entities.SaveChanges();
             return true;
         }
         else
         {
             return false;
         }
     }
     catch (Exception x)
     {
         throw x;
     }
 }