Example #1
0
        private async void DisplayCar(string carID)
        {
            Car car = await RentalCarsAPI.GetCarById(Guid.Parse(carID));

            Person person = await RentalCarsAPI.GetPersonByCardId(Guid.Parse(carID));

            labelCarModel.Text              = car.CarModel;
            labelEngineSize.Text            = Convert.ToString(car.EngineSize);
            labelFirstRegistrationDate.Text = Convert.ToString(car.FirstRegistrationDate);
            labelFuelType.Text              = Convert.ToString(car.FuelType);
            labelCarPlate.Text              = car.CarPlate;
            labelManufactureDate.Text       = Convert.ToString(car.ManufactoreDate);
            if (car.Rented == true)
            {
                labelRented.Text        = "Da";
                labelRentedDate.Visible = true;
                labelRentedUntil.Text   = Convert.ToString(person.ToDate);
                buttonRent.Text         = "FREE";
                buttonSeePerson.Visible = true;
            }
            else
            {
                labelRented.Text         = "Nu este inchiriat";
                labelRentedUntil.Visible = true;
                //labelRentedDate.Visible = false;
                labelRentedUntil.Text   = "Nu este inchiriat";
                buttonRent.Text         = "RENT";
                buttonSeePerson.Visible = false;
            }
        }
Example #2
0
        private async void ButtonBack_ClickResolve()
        {
            Car car = await RentalCarsAPI.GetCarById(Guid.Parse(carID));

            Person person = await RentalCarsAPI.GetPersonByCardId(Guid.Parse(carID));

            if (car.Rented == true)
            {
                await RentalCarsAPI.FreeCar(car.CarId);

                this.mainForm.OpenChildForm(new FormSelectedCar(mainForm, carID, username));
            }
            else
            {
                this.mainForm.OpenChildForm(new FormRentCar(mainForm, carID, username));
            }
        }
Example #3
0
        private async void DisplayPerson1(string carID)
        {
            Person person = await RentalCarsAPI.GetPersonByCardId(Guid.Parse(carID));

            History history = await RentalCarsAPI.GetHistoryByCNP(person.CNP);

            Car car = await RentalCarsAPI.GetCarById(Guid.Parse(carID));

            labelFirstName1.Text  = person.FirstName;
            labelLastName1.Text   = person.LastName;
            labelCNP1.Text        = person.CNP;
            labelCarCounter1.Text = Convert.ToString(history.Counter);
            labelRented1.Text     = "True";
            labelCar1.Text        = car.CarModel;
            labelFromDate1.Text   = Convert.ToString(person.FromDate);
            labelToDate1.Text     = Convert.ToString(person.ToDate);
        }