Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BuyMachine buyMachine = db.BuyMachines.Find(id);

            db.BuyMachines.Remove(buyMachine);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "id,Machine_id,UserName,Phno,Address,Email,Quantity")] BuyMachine buyMachine)
 {
     if (ModelState.IsValid)
     {
         db.Entry(buyMachine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(buyMachine));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "id,Machine_id,UserName,Phno,Address,Email,Quantity")] BuyMachine buyMachine)
        {
            if (ModelState.IsValid)
            {
                db.BuyMachines.Add(buyMachine);
                db.SaveChanges();
                TempData["orderresult"] = "Your order has been successfully placed";
            }

            return(View(buyMachine));
        }
Beispiel #4
0
        // GET: BuyMachines/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuyMachine buyMachine = db.BuyMachines.Find(id);

            if (buyMachine == null)
            {
                return(HttpNotFound());
            }
            return(View(buyMachine));
        }