Code cleanup
This commit is contained in:
@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EFB.Controllers.Form
|
||||
{
|
||||
public static class FormAuthenticator
|
||||
{
|
||||
|
||||
public static bool ValidateEMail(string EMail){
|
||||
|
||||
public static bool ValidateEMail(string EMail)
|
||||
{
|
||||
if (EMail != null && EMail.Contains("@") && EMail.Contains(".") && !EMail.Contains(" "))
|
||||
{
|
||||
if (EMail.Count(x => x == '@') == 1)
|
||||
@ -19,7 +17,8 @@ namespace EFB.Controllers.Form
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ValidateEndpoint(string Endpoint){
|
||||
public static bool ValidateEndpoint(string Endpoint)
|
||||
{
|
||||
//If it contains http & :// it can be either https or http
|
||||
if (Endpoint.Contains("http") && Endpoint.Contains("://") && Endpoint.Length > 7)
|
||||
{
|
||||
@ -28,7 +27,8 @@ namespace EFB.Controllers.Form
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ValidateICAOCode(string ICAO){
|
||||
public static bool ValidateICAOCode(string ICAO)
|
||||
{
|
||||
if (ICAO.Length == 4)
|
||||
{
|
||||
//If the value contains a Number, then the value will return false
|
||||
@ -37,7 +37,8 @@ namespace EFB.Controllers.Form
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ValidateCruiseAlt(uint CruiseAlt){
|
||||
public static bool ValidateCruiseAlt(uint CruiseAlt)
|
||||
{
|
||||
if (CruiseAlt > 0 && CruiseAlt < 50000)
|
||||
{
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user