Ejemplo n.º 1
0
        private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
        {
            var        selectedCar = CarList.SelectedItem as Car;
            CarService carservice  = new CarService(cars, rentcars);

            carservice.MakeRent(selectedCar, dateTimePicker1.Value, dateTimePicker2.Value);
        }
Ejemplo n.º 2
0
        private void dateTimePicker2_ValueChanged(object sender, System.EventArgs e)
        {
            CarList.DataSource = null;
            CarService carservice = new CarService(cars, rentcars);

            CarList.DataSource = carservice.AVailableCars(dateTimePicker1.Value, dateTimePicker2.Value);
        }
Ejemplo n.º 3
0
 private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
 {
     dateTimePicker2.MinDate = dateTimePicker1.Value;
     CarService carservice = new CarService(cars, rentcars);
     CarList.DataSource = null;
     CarList.DataSource = carservice.AVailableCars(dateTimePicker1.Value, dateTimePicker2.Value);
 }
Ejemplo n.º 4
0
 public CarRent()
 {
     InitializeComponent();
     service = new CarService();
     _DateOfBegin = dateTimePicker1.Value;
     _DateOfEnd = dateTimePicker2.Value;
     dateTimePicker1.MinDate = System.DateTime.Today;
     dateTimePicker2.MinDate = System.DateTime.Today;
 }
Ejemplo n.º 5
0
 private void reloadCar()
 {
     FileDatabase fbase = new FileDatabase(@"C:\holymosh\DBase");
     var all_cars = fbase.GetFromDatabase<Car>();
     FileDatabase rent_base = new FileDatabase(@"C:\holymosh\DBase");
     var rent_dates = rent_base.GetFromDatabase<Rent>();
     CarService service = new CarService(all_cars, rent_dates);
     service.getAvailableCars(dateTimePicker1.Value, dateTimePicker2.Value);
     Car[] available_cars = new Car[service.getCountOfCars];
     available_cars = service.available_cars;
     CarList.Items.Clear();
     CarList.Items.AddRange(available_cars);
 }
Ejemplo n.º 6
0
        private void CarRent_Load(object sender, System.EventArgs e)
        {
            FileDatabase car_base = new FileDatabase(@"C:\holymosh\DBase");
            var all_cars = car_base.GetFromDatabase<Car>();

            FileDatabase rent_base = new FileDatabase(@"C:\holymosh\DBase");
            var rent_dates = rent_base.GetFromDatabase<Rent>();
            CarService service = new CarService(all_cars, rent_dates);
            service.getAvailableCars(dateTimePicker1.Value, dateTimePicker2.Value);
            Car[] available_cars = new Car[service.getCountOfCars];
            available_cars = service.available_cars;
            CarList.Items.AddRange(available_cars);
        }
Ejemplo n.º 7
0
 public CarRent()
 {
     InitializeComponent();
     _carService = new CarService();
 }
Ejemplo n.º 8
0
 public AdminPanel(CarService service)
 {
     InitializeComponent();
 }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
0
 private void MakeAnOrderButton_Click(object sender, System.EventArgs e)
 {
     var selectedCar = CarList.SelectedItem as Car;
     CarService carservice = new CarService(cars, rentcars);
     carservice.MakeRent(selectedCar, dateTimePicker1.Value, dateTimePicker2.Value);
 }