Пример #1
0
 public Renting(int days, Drivers drive, car ca, int num_of_peo)
 {
     running_code     = 0;
     start_rent       = new DateTime();
     start_rent       = DateTime.Now;
     this.days        = days;
     driver           = drive;
     number_of_rishui = ca.car_number;
     number_of_pepole = num_of_peo;
     number_at_start  = ca.total_distance;
     is_defcive       = false;
     ended            = false;
 }
Пример #2
0
 public Renting(long run_code, Drivers dra, int car_num, int days, DateTime dt, DateTime dt1, bool a, float km, int aa, bool t, int tt)
 {
     running_code     = run_code;
     driver           = dra;
     number_of_rishui = car_num;
     this.days        = days;
     start_rent       = dt;
     end_rent         = dt1;
     is_defcive       = a;
     price            = aa;
     number_at_start  = km;
     ended            = t;
     number_at_end    = (number_drove = tt);
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public Renting(DateTime s, int c, int ks, int d1, int d2 = 0, int id = 0, DateTime?s2 = null, int ke = 0, bool r = false, double p = 0.0)
        {
            idNumber        = (id == 0) ? ++autoIncrement : id;
            rentalStartDate = s;
            carId           = c;
            driversNumber   = (d2 == 0) ? 1 : 2;
            driversAllowed  = new Drivers()
            {
                idClient1 = d1, idClient2 = d2
            };
            kilometersAtRentalStart = ks; // ks must be retrieved from kilometers of the car

            //optionals
            rentalEndDate         = (s2 == null) ? DateTime.MaxValue : (DateTime)s2;
            KilometersAtRentalEnd = ke;
            ReturnedWithFault     = r;
            RentalPriceDaily      = p;
        }