Example #1
0
        private void ShowReservationOnDetailsScreen(REZERWACJE reservation)
        {
            //Podstawowe informacje
            textBox17.Text = reservation.DataRez.ToString();
            textBox32.Text = reservation.DataWypoz.ToString();
            textBox33.Text = reservation.DataZwrotu.ToString();
            textBox34.Text = reservation.DataZdania?.ToString();
            textBox35.Text = ReservationListGrid.GetTextStatus(reservation.Wypozycz);

            //Dane klienta
            groupBox10.Visible = false;
            textBox36.Text     = reservation.KLIENCI.Imie + " " + reservation.KLIENCI.Nazwisko;
            textBox37.Text     = reservation.KLIENCI.Plec == 0 ? "Mężczyzna" : "Kobieta";
            textBox38.Text     = reservation.KLIENCI.Adres;
            textBox39.Text     = reservation.KLIENCI.NrDowOsob;
            textBox40.Text     = reservation.KLIENCI.Telefon;
            textBox41.Text     = reservation.KLIENCI.Login;

            //Pojazd
            if (reservation.POJAZDY.ZDJECIA.Count > 0)
            {
                pictureBox11.Image = PhotoService.ByteArrayToImage(reservation.POJAZDY.ZDJECIA.First().Zdjecie);
            }
            else
            {
                pictureBox11.Image = Properties.Resources.no_car_image;
            }

            textBox42.Text    = VehicleListGrid.GetTextType(reservation.POJAZDY.Rodzaj);
            textBox43.Text    = reservation.POJAZDY.MARKI.Nazwa;
            textBox44.Text    = reservation.POJAZDY.Kolor;
            textBox45.Text    = reservation.POJAZDY.DataProd.ToString("d");
            textBox46.Text    = reservation.POJAZDY.Przebieg.ToString() + " km";
            textBox47.Text    = reservation.POJAZDY.ZaGodz.ToString("C");
            richTextBox3.Text = reservation.POJAZDY.Opis;

            //Opinie
            comboBox2.SelectedIndex = 0;
            richTextBox2.Text       = "";
            var isNoOpinion = reservation.OPINIA.Count == 0 && reservation.Wypozycz == 2 ? true : false;

            button1.Enabled      = isNoOpinion;
            richTextBox4.Enabled = isNoOpinion;
            comboBox2.Enabled    = isNoOpinion;
            if (!isNoOpinion && reservation.OPINIA.Count > 0)
            {
                var opinia = reservation.OPINIA.First();
                richTextBox4.Text       = opinia.Opis;
                comboBox2.SelectedIndex = opinia.Ocena - 1;
            }

            //Realizacja
            textBox23.Text = reservation.PRACOWNICY?.ToString();
            textBox24.Text = reservation.PRACOWNICY1?.ToString();
        }
Example #2
0
        private void LoadReservationOnDetailsScreen(REZERWACJE reservation)
        {
            //Podstawowe informacje
            textBox10.Text = reservation.DataRez.ToString("dd.MM.yyyy HH:mm");
            textBox32.Text = reservation.DataWypoz.ToString("dd.MM.yyyy HH:mm");
            textBox33.Text = reservation.DataZwrotu.ToString("dd.MM.yyyy HH:mm");
            textBox34.Text = reservation.DataZdania?.ToString("dd.MM.yyyy HH:mm");
            textBox35.Text = ReservationListGrid.GetTextStatus(reservation.Wypozycz);

            //Dane klienta
            textBox36.Text = reservation.KLIENCI.Imie + " " + reservation.KLIENCI.Nazwisko;
            textBox37.Text = reservation.KLIENCI.Plec == 0 ? "Mężczyzna" : "Kobieta";
            textBox38.Text = reservation.KLIENCI.Adres;
            textBox39.Text = reservation.KLIENCI.NrDowOsob;
            textBox40.Text = reservation.KLIENCI.Telefon;
            textBox41.Text = reservation.KLIENCI.Login;

            //Pojazd
            if (reservation.POJAZDY.ZDJECIA.Count > 0)
            {
                pictureBox11.Image = PhotoService.ByteArrayToImage(reservation.POJAZDY.ZDJECIA.First().Zdjecie);
            }
            else
            {
                pictureBox11.Image = Properties.Resources.no_car_image;
            }

            textBox42.Text    = VehicleListGrid.GetTextType(reservation.POJAZDY.Rodzaj);
            textBox43.Text    = reservation.POJAZDY.MARKI.Nazwa;
            textBox44.Text    = reservation.POJAZDY.Kolor;
            textBox45.Text    = reservation.POJAZDY.DataProd.ToString("d");
            textBox46.Text    = reservation.POJAZDY.Przebieg.ToString() + " km";
            textBox47.Text    = reservation.POJAZDY.ZaGodz.ToString("C");
            richTextBox3.Text = reservation.POJAZDY.Opis;

            //Wydaj
            textBox50.Text            = DateTime.Now.ToString("dd.MM.yyyy HH:mm");
            checkBox6.Enabled         = reservation.Wypozycz == 0 ? true : false;
            checkBox6.Checked         = false;
            wydajPojazdButton.Enabled = reservation.Wypozycz == 0 ? true : false;

            //Odbierz
            textBox49.Text              = DateTime.Now.ToString("dd.MM.yyyy HH:mm");
            checkBox3.Enabled           = reservation.Wypozycz == 1 ? true : false;
            checkBox3.Checked           = false;
            odbierzPojazdButton.Enabled = reservation.Wypozycz == 1 ? true : false;
        }