예제 #1
0
        public ActionResult Edit(DepartmentManageEditRequest model)
        {
            _departmentService.Edit(new Department
            {
                IsEnable = model.IsEnable,
                Id       = model.Id,
                Order    = model.Order,
                Title    = model.Title
            });

            return(RedirectToAction("Index"));
        }
예제 #2
0
        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));
        }