Exemplo n.º 1
0
 public JsonResult Save([Bind(Include = "Id,Name,Description,IsActive")] DepartmentModel department, bool isInsert)
 {
     if (isInsert)
     {
         department.SetCreateProperties(LoginInformation.UserInformation.Id);
         department.Id = _departmentService.Insert(department);
     }
     else
     {
         department.SetUpdateProperties(LoginInformation.UserInformation.Id);
         _departmentService.Update(department);
     }
     return new JsonResult { Data = department };
 }