public ActionResult DeleteConfirmed(int id) { BuyPestiside buyPestiside = db.BuyPestisides.Find(id); db.BuyPestisides.Remove(buyPestiside); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }