public ActionResult DeleteConfirmed(int id) { Product_tbl product_tbl = db.Product_tbl.Find(id); db.Product_tbl.Remove(product_tbl); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteConfirmed(int id) { Product_tbl product_tbl = await db.Product_tbl.FindAsync(id); db.Product_tbl.Remove(product_tbl); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "pr_id,pr_name,pr_createdby,pr_createdat,pr_updatedby,pr_updatedat,pr_isdeleted")] Product_tbl product_tbl) { if (ModelState.IsValid) { db.Entry(product_tbl).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(product_tbl)); }
public ActionResult Edit([Bind(Include = "Product_id,Product_name,Rate,Model_id")] Product_tbl product_tbl) { if (ModelState.IsValid) { db.Entry(product_tbl).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Model_id = new SelectList(db.ProductDetails, "Model_id", "Model_name", product_tbl.Model_id); return(View(product_tbl)); }
public async Task <ActionResult> Create([Bind(Include = "pr_id,pr_name,pr_createdby,pr_createdat,pr_updatedby,pr_updatedat,pr_isdeleted")] Product_tbl product_tbl) { if (ModelState.IsValid) { db.Product_tbl.Add(product_tbl); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(product_tbl)); }
// GET: Product/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_tbl product_tbl = await db.Product_tbl.FindAsync(id); if (product_tbl == null) { return(HttpNotFound()); } return(View(product_tbl)); }
// GET: Product_tbl/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_tbl product_tbl = db.Product_tbl.Find(id); if (product_tbl == null) { return(HttpNotFound()); } return(View(product_tbl)); }
// GET: Product_tbl/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Product_tbl product_tbl = db.Product_tbl.Find(id); if (product_tbl == null) { return(HttpNotFound()); } ViewBag.Model_id = new SelectList(db.ProductDetails, "Model_id", "Model_name", product_tbl.Model_id); return(View(product_tbl)); }