Пример #1
0
        public ActionResult Update(DepartmentViewModel model)
        {
            ResponseViewModel resp = new ResponseViewModel();

            try
            {
                resp = DepartmentObject.Update(model);
            }
            catch (Exception ex)
            {
                resp.Success = false;
                resp.Message = ex.Message;
            }

            return(Json(resp, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
 public ActionResult Edit(DepartmentModel model)
 {
     if (DepartmentBO.GetById(model.Id) != null)
     {
         if (Validate(model))
         {
             DepartmentBO.Update(model.Id, model.Name, model.UserId, DateTime.Now, DateTime.Now, CurrentUser.Id, CurrentUser.Id);
             return(RedirectToAction("Index"));
         }
     }
     else
     {
         return(RedirectToAction("NotFound", "Home"));
     }
     ViewBag.ListUsers = UserBO.GetAll();
     return(View(model));
 }