Beispiel #1
0
 public void RentOfCar(DateTime fromTime, DateTime toTime, Car currentCar)
 {
     Rent newRentedCar;
     FileDatabase addingRent = new FileDatabase("data");
     fromTime = ConvertToDate(fromTime);
     toTime = ConvertToDate(toTime);
     newRentedCar = new Rent(currentCar, fromTime, toTime);
     _rentedCars.Add(newRentedCar);
     addingRent.SaveToDatabase(_rentedCars.ToArray());
 }
Beispiel #2
0
        private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
        {
            if (Controles.controlDate(dateTimePicker1.Value, dateTimePicker2.Value) == false) MessageBox.Show("Неверно введена дата.");
            else
            {
                Rent rent = new Rent(dateTimePicker1.Value, dateTimePicker2.Value, (Car)CarList.SelectedItem);

                carService.makeRent(rent);

            }
        }
Beispiel #3
0
 public void DoAnOrder(Rent OrderParams)
 {
     Rent[] OldArrOfRents = PreventiveDB;
     Rent[] NewArrOfRents = new Rent[OldArrOfRents.GetLength(0) + 1];
     int i;
     for (i = 0; i < OldArrOfRents.GetLength(0); ++i)
         NewArrOfRents[i] = OldArrOfRents[i];
     NewArrOfRents[i] = OrderParams;
     PreventiveDB = NewArrOfRents;
     db.SaveToDatabase<Rent>(NewArrOfRents);
 }
Beispiel #4
0
 public makeRent(Rent car)
 {
 }
Beispiel #5
0
 public void MakeRent(Rent NewRent)
 {
     ListOfRents.Add(NewRent);
     DataBase.SaveToDatabase<Rent>(ListOfRents.ToArray());
 }
Beispiel #6
0
 private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
 {
     var selectedCar = CarList.SelectedItem as Car;
     Rent rentCar = new Rent(selectedCar, dateTimePicker1.Value, dateTimePicker2.Value);
 }
Beispiel #7
0
 private void updateRentButton_Click(object sender, EventArgs e)
 {
     CarService carService = new CarService();
     Car car = carRentedList.SelectedItem as Car;
     DateTime from = carService.ConvertToDate(dateTimePicker1.Value);
     DateTime to = carService.ConvertToDate(dateTimePicker2.Value);
     Rent rent = new Rent(car, from, to);
     Rent currentRent = rentListInAdmin.SelectedItem as Rent;
     _adminForRent.ChangeRent(currentRent, rent);
     rentListInAdmin.DataSource = _adminForRent.GetRentForCar(car);
 }
Beispiel #8
0
 public CarService(Car[] all_cars, Rent[] rent_records)
 {
     this.all_cars = all_cars;
     this.rent_records = rent_records;
     count_of_available_cars = 0;
 }
Beispiel #9
0
 private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
 {
     Rent OrderParams = new Rent(_selectedCar, _DateOfBegin, _DateOfEnd);
     service.DoAnOrder(OrderParams);
     ReloadCarList();
 }
Beispiel #10
0
 private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
 {
     Rent NewRent = new Rent(selectedCar, _DateFrom, _DateTo);
     _CarService.MakeRent(NewRent);
     RefreshListOfCars();
 }
Beispiel #11
0
 public void makeRent(Rent rent)
 {
     listRent.Add(rent);
     db.SaveToDatabase(listRent.ToArray());
 }
Beispiel #12
0
 public void MakeRent(Rent NewRent)
 {
     ListOfRents.Add(NewRent);
     DataBase.SaveToDatabase <Rent>(ListOfRents.ToArray());
 }