コード例 #1
0
        private void ViewRentalLoadRentalData()
        {
            // Rental
            textBoxRentalCodeViewRental.Text  = _rental.Code;
            textBoxBookingDateViewRental.Text = _rental.BookingDateTime.ToString("dd-MM-yyyy");
            textBoxBookingTimeViewRental.Text = _rental.BookingDateTime.ToString("HH:mm:ss");
            textBoxStartDateViewRental.Text   = _rental.StartDate.ToString("dd-MM-yyyy");
            textBoxEndDateViewRental.Text     = _rental.EndDate.ToString("dd-MM-yyyy");

            textBoxDurationViewRental.Text = _rental.Duration.ToString();
            textBoxStatusViewRental.Text   = _rental.Status;

            if (!_rental.ReturnDateTime.Date.ToString("dd-MM-yyyy").Equals("01-01-0001"))
            {
                textBoxReturnDateViewRental.Text = _rental.ReturnDateTime.ToString("dd-MM-yyyy");
                textBoxReturnTimeViewRental.Text = _rental.ReturnDateTime.ToString("HH:mm:ss");
            }
            pictureBoxQRCodeViewRental.Image = _rentalController.GenerateQR(_rental.Key);

            // Customer
            textBoxCustomerNameViewRental.Text = _customer.Name;
            textBoxCustomerIcViewRental.Text   = _customer.IcPassport;

            // Employee
            textBoxEmployeeNameViewRental.Text = _employee.Name;
            textBoxEmployeeIcViewRental.Text   = _employee.IcPassport;

            // Locker
            textBoxLockerCodeViewRental.Text    = _locker.Code;
            textBoxLockerCabinetViewRental.Text = _cabinet.Code;
            textBoxLockerSizeViewRental.Text    = _lockerType.Name;
            textBoxLockerRateViewRental.Text    = _lockerType.Rate.ToString("F2");

            // Payment
            textBoxTotalPriceViewRental.Text = (_lockerType.Rate * _rental.Duration).ToString("F2");
        }