public ActionResult Edit([Bind(Include = "TypeId,CategoryId,Name,Description,IsActive")] SMA_Inventory_Category_Type sMA_Inventory_Category_Type) { if (ModelState.IsValid) { db.Entry(sMA_Inventory_Category_Type).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.SMA_Inventory_Category, "CategoryId", "Name", sMA_Inventory_Category_Type.CategoryId); return(View(sMA_Inventory_Category_Type)); }
public ActionResult DeleteConfirmed(int id) { SMA_Inventory_Category_Type sMA_Inventory_Category_Type = db.SMA_Inventory_Category_Type.Find(id); sMA_Inventory_Category_Type.IsActive = false; sMA_Inventory_Category_Type.InActiveDT = DateTime.Now; CustomIdentity iden = (CustomIdentity)HttpContext.User.Identity; sMA_Inventory_Category_Type.InActiveBy = iden.UserId; db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Setting/InventoryCategoryType/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SMA_Inventory_Category_Type sMA_Inventory_Category_Type = db.SMA_Inventory_Category_Type.Find(id); if (sMA_Inventory_Category_Type == null) { return(HttpNotFound()); } return(View(sMA_Inventory_Category_Type)); }
// GET: Setting/InventoryCategoryType/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SMA_Inventory_Category_Type sMA_Inventory_Category_Type = db.SMA_Inventory_Category_Type.Find(id); if (sMA_Inventory_Category_Type == null) { return(HttpNotFound()); } ViewBag.CategoryId = new SelectList(db.SMA_Inventory_Category, "CategoryId", "Name", sMA_Inventory_Category_Type.CategoryId); return(View(sMA_Inventory_Category_Type)); }