public ActionResult DeleteConfirmed(int id) { MasterPurchaseRates masterPurchaseRates = db.masterPurchaseRates.Find(id); db.masterPurchaseRates.Remove(masterPurchaseRates); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasterPurchaseRates masterPurchaseRates = db.masterPurchaseRates.Find(id); if (masterPurchaseRates == null) { return(HttpNotFound()); } return(View(masterPurchaseRates)); }
public ActionResult Edit(MasterPurchaseRates masterPurchaseRates) { if (ModelState.IsValid) { db.Entry(masterPurchaseRates).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Product1 = new SelectList(db.masterProducts, "ProductID", "ProductName"); ViewBag.Size1 = new SelectList(db.masterSizes, "SizeID", "Size"); ViewBag.Supplier1 = new SelectList(db.masterSuppliers, "SupplierID", "Name"); ViewBag.Unit1 = new SelectList(db.masterUnits, "UnitID", "Unit"); ViewBag.Vendor1 = new SelectList(db.masterVendors, "VendorID", "Name"); return(View(masterPurchaseRates)); }
// GET: MasterPurchaseRates/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasterPurchaseRates masterPurchaseRates = db.masterPurchaseRates.Find(id); if (masterPurchaseRates == null) { return(HttpNotFound()); } ViewBag.Product1 = new SelectList(db.masterProducts, "ProductID", "ProductName"); ViewBag.Size1 = new SelectList(db.masterSizes, "SizeID", "Size"); ViewBag.Supplier1 = new SelectList(db.masterSuppliers, "SupplierID", "Name"); ViewBag.Unit1 = new SelectList(db.masterUnits, "UnitID", "Unit"); ViewBag.Vendor1 = new SelectList(db.masterVendors, "VendorID", "Name"); return(View(masterPurchaseRates)); }