Пример #1
0
        public static User NewUser()
        {
            Console.Clear();
            User user = new User();

            Console.Write(Constant.UserId);
            user.Id = Helper.GetValidUserName();

            Console.Write(Constant.Password);
            user.Password = Helper.ValidString();

            Console.Write(Constant.Name);
            user.Name = Helper.ValidString();

            Console.Write(Constant.MobileNumber);
            user.MobileNumber = Helper.ValidString();

            Console.Write(Constant.Email);
            user.Email = Helper.GetValidEmail();

            Console.Write(Constant.Address);
            user.Address = Helper.ValidString();

            Console.Write(Constant.DrivingLicenceNumber);
            user.DrivingLicence = Console.ReadLine();

            Console.Write(Constant.IdProofNumber);
            user.IdProofNumber = Helper.ValidString();

            return(user);
        }
Пример #2
0
        public static Car GetCarDetails()
        {
            Car car = new Car();

            Console.WriteLine(Constant.CarDetail);
            Console.Write(Constant.CarNumber);
            car.Number = Helper.ValidString();

            Console.Write(Constant.CarModel);
            car.Model = Helper.ValidString();

            Console.Write(Constant.CarCapacity);
            car.MaxSeatCapacity = Helper.ValidInteger();

            while (true)
            {
                Console.Write(Constant.VacantSeat);
                car.VacantSeat = Helper.ValidInteger();
                if (car.VacantSeat <= car.MaxSeatCapacity)
                {
                    break;
                }
                Console.WriteLine(Constant.InvalidVacantSeat);
            }

            return(car);
        }
Пример #3
0
        public static Login GetCredential()
        {
            Login login = new Login();

            Console.Write(Constant.UserId);
            login.UserName = Helper.ValidString();

            Console.Write(Constant.Password);
            login.Password = Helper.ValidString();

            return(login);
        }
Пример #4
0
        public static Car GetCarDetails()
        {
            Car car = new Car();

            Console.WriteLine(Constant.CarDetails);
            Console.Write(Constant.CarNumber);
            car.Number = Helper.ValidString();

            Console.Write(Constant.CarModel);
            car.Model = Helper.ValidString();

            Console.Write(Constant.CarMaxSeats);
            car.NoofSeat = Helper.ValidInteger();

            return(car);
        }
Пример #5
0
        public void UpdateMenu()
        {
            Console.WriteLine(Constant.UpdateUserDetailOptions);
            User user = AppDataService.Users?.FirstOrDefault(a => a.Id == this.Id);
            UpdateUserDetailMenu op = (UpdateUserDetailMenu)Helper.ValidInteger();

            switch (op)
            {
            case UpdateUserDetailMenu.Name:
                user.Name = Helper.ValidString();
                break;

            case UpdateUserDetailMenu.Mobile:
                user.Mobile = Console.ReadLine();
                break;

            case UpdateUserDetailMenu.Email:
                user.Email = Helper.GetValidEmail();
                break;

            case UpdateUserDetailMenu.Address:
                user.Address = Console.ReadLine();
                break;

            case UpdateUserDetailMenu.DrivingLicence:
                user.DrivingLicence = Console.ReadLine();
                break;

            case UpdateUserDetailMenu.Signout:
                Program.MainMenu();
                break;

            case UpdateUserDetailMenu.Exit:
                Environment.Exit(0);
                break;
            }
        }