Exemplo n.º 1
0
        public bool AddDriver()
        {
            Console.WriteLine("Введите ФИО водителя: ");
            string        FIO = Console.ReadLine();
            ClassOfDriver q   = ClassOfDriver.first;

            Console.WriteLine("Выберите квалификацию водителя: first, second, third.");
            string qu = Console.ReadLine();

            if (qu == "second")
            {
                q = ClassOfDriver.second;
            }
            else if (qu == "third")
            {
                q = ClassOfDriver.third;
            }
            return(factory.AddDriver(FIO, q));
        }
Exemplo n.º 2
0
        public bool Add(string login, string password, string userName, ClassOfDriver qualification)
        {
            UserDriver driver = new UserDriver(login, password, userName);

            if (connector.Create(driver) != null)
            {
                bool result = Enterprice.AddDriver(userName, qualification);
                if (result)
                {
                    return(true);
                }
                else
                {
                    connector.Delete(driver.Id);
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }