示例#1
0
 public JSendResponse UpdateUserDetails(User user)
 {
     if (user == null)
     {
         throw new ArgumentNullException("User id is null");
     }
     try
     {
         int employeeId = Convert.ToInt32(user.EmployeeId);
     }
     catch (FormatException ex)
     {
         throw new FormatException("Invalid format of employee Id", ex);
     }
     if (Convert.ToInt32(user.EmployeeId) < 0)
     {
         throw new ArithmeticException("Employee id cannot be negative");
     }
     if (Convert.ToInt32(user.ProjectId) < 0)
     {
         throw new ArithmeticException("Project id cannot be negative");
     }
     if (user.UserId <= 0)
     {
         throw new ArithmeticException("User id cannot be negative or 0");
     }
     return(new JSendResponse()
     {
         Data = _userObjBC.UpdateUserDetails(user)
     });
 }
示例#2
0
 public JSendResponse UpdateUserDetails(User user)
 {
     return(new JSendResponse()
     {
         Data = _userObjBC.UpdateUserDetails(user)
     });
 }