Exemplo n.º 1
0
 public ActionResult Edit(Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         invoiceRepo.Update(invoice);
         invoiceRepo.Save();
         return Json(new { success = true });
     }
     return PartialView("Edit", invoice);
 }
Exemplo n.º 2
0
 public JsonResult Create(Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         invoice.CreatedBy = Request.Cookies["USER"].Value;
         invoice.CreationDate = DateTime.Now;
         invoiceRepo.Insert(invoice);
         invoiceRepo.Save();
         return Json(new { success = true });
     }
     return Json(invoice, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 3
0
 public void Delete(Invoice entity)
 {
     context.Invoices.Remove(entity);
 }
Exemplo n.º 4
0
 public void Update(Invoice entity)
 {
     context.Entry(entity).State = System.Data.Entity.EntityState.Modified;
 }
Exemplo n.º 5
0
 public void Insert(Invoice entity)
 {
     context.Invoices.Add(entity);
 }