Exemplo n.º 1
0
 public bool AddNewInvoice(DB.CompanyInvoice invoice)
 {
     using (var context = new MyContext())
     {
         context.CompanyInvoices.Add(invoice);
         context.SaveChanges();
         return(true);
     }
 }
Exemplo n.º 2
0
 public DB.CompanyInvoice EditInvoice(DB.CompanyInvoice invoice)
 {
     using (var context = new MyContext())
     {
         if (invoice != null)
         {
             context.Entry(invoice).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
             return(invoice);
         }
         return(null);
     }
 }