Ejemplo n.º 1
0
        public ActionResult Create(BillDetail billdetail)
        {
            if (ModelState.IsValid)
            {
                db.BillDetail.Add(billdetail);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.Bill = new SelectList(db.Bill, "Id", "PaymentType", billdetail.Bill);
            ViewBag.Product = new SelectList(db.Products, "Id", "Name", billdetail.Product);
            return View(billdetail);
        }
Ejemplo n.º 2
0
 public ActionResult Edit(BillDetail billdetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(billdetail).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.Bill = new SelectList(db.Bill, "Id", "PaymentType", billdetail.Bill);
     ViewBag.Product = new SelectList(db.Products, "Id", "Name", billdetail.Product);
     return View(billdetail);
 }