
namespace Reconstruction.Functions
{
    public static class Registration
    {
        public static void Register()
        {
            string FirstName;
            string LastName;
            string MiddleName;
            string Login;
            string Password;
            string Phone;

            Console.Clear();

            User user = new User();
            Console.Write("Enter your first name: ");
            {
                FirstName = Convert.ToString(Console.ReadLine());
                user.Firstname = FirstName;
            }

            Console.Write("\nEnter your last name: ");
            {
                LastName = Convert.ToString(Console.ReadLine());
                user.Lastname = LastName;
            }

            Console.Write("\nEnter your middle names if you have this: ");
            {
                MiddleName = Convert.ToString(Console.ReadLine());
                user.Middlename = MiddleName;
            }

            Console.Write("\nEnter your login: ");
            {
                Login = Convert.ToString(Console.ReadLine());
                user.Login = Login;
            }

            Console.Write("\nEnter your password: ");
            {
                Password = Convert.ToString(Console.ReadLine());
                user.Password = Password;
            }

            Console.Write("\nEnter your phone number if you wish: ");
            {
                Phone = Convert.ToString(Console.ReadLine());
                user.Phone = Phone;
            }


            Service.db.Users.Add(user);
            Service.db.SaveChanges();

            Console.Clear();

        }
    }
}
