private string ValidateNewDepartment(CachedUser user) { if (user == null || !Permissions.CanAddDepartment(user.RoleId)) { return("Insufficient Permissions."); } if (string.IsNullOrWhiteSpace(DepartmentNameInput.Text)) { return("Department name cannot be empty."); } if (_departmentDal.GetByName(DepartmentNameInput.Text, user.CompanyId) != null) { return("Department with the same name already exists."); } return(string.Empty); }