コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            InviceDetails inviceDetails = db.InviceDetails.Find(id);

            db.InviceDetails.Remove(inviceDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,ProductName,Amount,InvoicesID")] InviceDetails inviceDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(inviceDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.InvoicesID = new SelectList(db.Invoices, "ID", "ID", inviceDetails.InvoicesID);
     return(View(inviceDetails));
 }
コード例 #3
0
        // GET: InviceDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InviceDetails inviceDetails = db.InviceDetails.Find(id);

            if (inviceDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(inviceDetails));
        }
コード例 #4
0
        // GET: InviceDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InviceDetails inviceDetails = db.InviceDetails.Find(id);

            if (inviceDetails == null)
            {
                return(HttpNotFound());
            }
            ViewBag.InvoicesID = new SelectList(db.Invoices, "ID", "ID", inviceDetails.InvoicesID);
            return(View(inviceDetails));
        }