Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BuyPestiside buyPestiside = db.BuyPestisides.Find(id);

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

            return(View(buyPestiside));
        }
Example #4
0
        // GET: BuyPestisides/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuyPestiside buyPestiside = db.BuyPestisides.Find(id);

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