Пример #1
0
 public Int64 InsertInvoice(Invoice invoice)
 {
     using (InvoiceModuleContext dbContext = new InvoiceModuleContext())
     {
         dbContext.invoices.Add(invoice);
         dbContext.SaveChanges();
         return(invoice.Id);
     }
 }
Пример #2
0
 public void UpdateInvoice(Invoice invoice)
 {
     using (InvoiceModuleContext dbContext = new InvoiceModuleContext())
     {
         invoice.Modifieddate = DateTime.Now;
         dbContext.Update(invoice);
         dbContext.SaveChanges();
     }
 }
Пример #3
0
 public void UpdateRGNotes(Invoice notes)
 {
     using (InvoiceModuleContext dbContext = new InvoiceModuleContext())
     {
         var invoice = dbContext.invoices.Where(x => x.Id == notes.Id).First();
         invoice.RGNotes      = notes.RGNotes;
         invoice.Modifieddate = DateTime.Now;
         dbContext.SaveChanges();
     }
 }
Пример #4
0
        public Int64 InsertRGDetails(RGDetails model)
        {
            using (InvoiceModuleContext dbContext = new InvoiceModuleContext())
            {
                model.Createddate = DateTime.Now;

                dbContext.rgDetails.Add(model);
                dbContext.SaveChanges();
                return(model.Id);
            }
        }
Пример #5
0
 public void DeleteMPDetails(List <int> selectedMPIds)
 {
     using (InvoiceModuleContext dbContext = new InvoiceModuleContext())
     {
         selectedMPIds.ForEach(x =>
         {
             var mpDetails       = dbContext.mpDetails.Where(m => m.Id.Equals(x)).FirstOrDefault();
             mpDetails.IsDeleted = true;
             dbContext.SaveChanges();
         });
     }
 }