public ActionResult DeleteConfirmed(int id) { SeedSelling seedSelling = db.SeedSellings.Find(id); db.SeedSellings.Remove(seedSelling); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,CustomerID,CropVarietyID,NoofBags,Amount")] SeedSelling seedSelling) { if (ModelState.IsValid) { db.Entry(seedSelling).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CropVarietyID = new SelectList(db.CropVarieties, "ID", "VarietyName", seedSelling.CropVarietyID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "CustomerName", seedSelling.CustomerID); return(View(seedSelling)); }
// GET: SeedSellings/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeedSelling seedSelling = db.SeedSellings.Find(id); if (seedSelling == null) { return(HttpNotFound()); } return(View(seedSelling)); }
// GET: SeedSellings/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SeedSelling seedSelling = db.SeedSellings.Find(id); if (seedSelling == null) { return(HttpNotFound()); } ViewBag.CropVarietyID = new SelectList(db.CropVarieties, "ID", "VarietyName", seedSelling.CropVarietyID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "CustomerName", seedSelling.CustomerID); return(View(seedSelling)); }