private static Task <ValidateResult> ValidateNameInfo(TicketModel state, object value) { var result = new ValidateResult(); string usernameInfo = string.Empty; if (GetUsername((string)value, out usernameInfo)) { result.IsValid = true; result.Value = usernameInfo; } else { result.IsValid = false; result.Feedback = "Please enter name a valid name"; } return(Task.FromResult(result)); }
private static Task <ValidateResult> ValidateDescInfo(TicketModel state, object value) { var result = new ValidateResult(); string descInfo = string.Empty; if (GetDescription((string)value, out descInfo)) { result.IsValid = true; result.Value = descInfo; } else { result.IsValid = false; result.Feedback = "Please enter a valid response"; } return(Task.FromResult(result)); }
private static Task <ValidateResult> ValidateMiddlewareInfo(TicketModel state, object value) { var result = new ValidateResult(); string MiddlewareInfo = string.Empty; if (GetMiddlewareInfo((string)value, out MiddlewareInfo)) { result.IsValid = true; result.Value = MiddlewareInfo; } else { result.IsValid = false; result.Feedback = "Please enter a valid Server information"; } return(Task.FromResult(result)); }
private static Task <ValidateResult> ValidateContactInformation(TicketModel state, object value) { var result = new ValidateResult(); string contactInfo = string.Empty; if (GetEmailAddress((string)value, out contactInfo)) { result.IsValid = true; result.Value = contactInfo; } else { result.IsValid = false; result.Feedback = "You did not enter a valid email address"; } return(Task.FromResult(result)); }
private static Task <ValidateResult> ValidatePhoneContact(TicketModel state, object value) { var result = new ValidateResult(); string PhoneInfo = string.Empty; if (GetContactInfo((string)value, out PhoneInfo)) { result.IsValid = true; result.Value = PhoneInfo; } else { result.IsValid = false; result.Feedback = "Please enter a valid contact number"; } return(Task.FromResult(result)); }
private string GenerateEmailMessage(TicketModel token) { throw new NotImplementedException(); }
private static bool DescriptionEnabled(TicketModel state) => !string.IsNullOrWhiteSpace(state.ServerName) && !string.IsNullOrWhiteSpace(state.Name) && !string.IsNullOrWhiteSpace(state.Desc) && !string.IsNullOrWhiteSpace(state.MiddlewareName) && !string.IsNullOrWhiteSpace(state.DBName);