public JSendResponse InsertUserDetails(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"); } return(new JSendResponse() { Data = _userObjBC.InsertUserDetails(user) }); }