public ActionResult Edit(ASF.Entities.Category model) { if (ModelState.IsValid) { var cp = new ASF.UI.Process.CategoryProcess(); model.ChangedOn = DateTime.Now; if (model.CreatedBy == 0) { model.CreatedBy = null; } cp.Edit(model); } return(RedirectToAction("Index")); }
public ActionResult Edit(int id, FormCollection collection) { try { var category = categoryProcess.Find(id); category.Name = collection["Name"]; category.ChangedOn = DateTime.Now; categoryProcess.Edit(category); return(RedirectToAction("Index")); } catch (Exception e) { throw new Exception(e.Message); //return View(); } }