示例#1
0
        private string ValidateNewServer(CachedUser user)
        {
            if (user == null || !Permissions.CanAddServer(user.RoleId))
            {
                return("Insufficient Permissions.");
            }

            if (string.IsNullOrWhiteSpace(ServerNameInput.Text))
            {
                return("Server name cannot be empty.");
            }

            if (_serverDal.GetByName(ServerNameInput.Text, user.CompanyId) != null)
            {
                return("Server with the same name already exists.");
            }

            return(string.Empty);
        }