Пример #1
0
 public string AddPerson(string FirstName, string SecondName, string Email, string Password)
 {
     if (Email.Length < 8 || Email.Contains("@") == false || Email.Contains(".") == false)
     {
         return("Wrong email");
     }
     if (Password.Length < 8)
     {
         return("Password must have minimum 8 sumvols");
     }
     if (FirstName.Length == 0 || SecondName.Length == 0)
     {
         return("You need input FirstName and SecondName");
     }
     if (ClassWork.AddPerson(new Person()
     {
         Email = Email, Password = Password, FirstName = FirstName, SecondName = SecondName
     }) == true)
     {
         return("Person is create");
     }
     else
     {
         return("Email  was in db or something wrong");
     }
 }
Пример #2
0
 public string AddPerson(string FirstName, string SecondName, string Email, string Password, bool Gender = false, byte[] Img = null)
 {
     if (Email.Length < 8 || Email.Contains("@") == false || Email.Contains(".") == false)
     {
         return("Wrong email");
     }
     if (Password.Length < 8)
     {
         return("Password must have minimum 8 sumvols");
     }
     if (FirstName.Length == 0 || SecondName.Length == 0)
     {
         return("You need input FirstName and SecondName");
     }
     return(ClassWork.AddPerson(new Person()
     {
         Email = Email, Password = Password, FirstName = FirstName, SecondName = SecondName, Gender = Gender, Image = Img
     }));
 }