Exemplo n.º 1
0
        public ActionResult Create(InvoiceDetail invoicedetail)
        {
            if (ModelState.IsValid)
            {
                db.InvoiceDetails.Add(invoicedetail);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.IdInvoiceMaster = new SelectList(db.InvoiceMasters, "IdInvoiceMaster", "NumInvoiceMaster", invoicedetail.IdInvoiceMaster);
            return View(invoicedetail);
        }
Exemplo n.º 2
0
 public ActionResult Edit(InvoiceDetail invoicedetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoicedetail).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.IdInvoiceMaster = new SelectList(db.InvoiceMasters, "IdInvoiceMaster", "NumInvoiceMaster", invoicedetail.IdInvoiceMaster);
     return View(invoicedetail);
 }