Ejemplo 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));
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 3
0
 public List <Driver> AddDriver(string fio, ClassOfDriver qualification) => (List <Driver>)DBDrivers.Create(new Driver(fio, qualification));
Ejemplo n.º 4
0
 public Driver(int Id, string Name, string Qualification)
 {
     this.Id            = Id;
     this.Name          = Name;
     this.Qualification = (ClassOfDriver)Enum.Parse(typeof(ClassOfDriver), Qualification);
 }
Ejemplo n.º 5
0
 public Driver(string Name, ClassOfDriver Qualification)
 {
     Id                 = 0;
     this.Name          = Name;
     this.Qualification = Qualification;
 }
Ejemplo n.º 6
0
 public Driver(int Id, string Name, ClassOfDriver Qualification)
 {
     this.Id            = Id;
     this.Name          = Name;
     this.Qualification = Qualification;
 }