public ActionResult Edit(DepartmentManageEditRequest model) { _departmentService.Edit(new Department { IsEnable = model.IsEnable, Id = model.Id, Order = model.Order, Title = model.Title }); return(RedirectToAction("Index")); }
public ActionResult Edit(int id = 0) { if (id <= 0) { return(RedirectToAction("Index")); } var dbModel = _departmentService.Get(id); var viewModel = new DepartmentManageEditRequest { Id = dbModel.Id, IsEnable = dbModel.IsEnable, Order = dbModel.Order, Title = dbModel.Title }; return(View(viewModel)); }