Пример #1
0
        private bool LoadClientFromEditScreen(KLIENCI editClient)
        {
            var tmp = textBox10.TextOrDefault();

            if (tmp == null)
            {
                return(false);
            }
            editClient.Imie = tmp;

            editClient.DrugieImie = textBox11.TextOrDefault();

            tmp = textBox13.TextOrDefault();
            if (tmp == null)
            {
                return(false);
            }
            editClient.Nazwisko = tmp;

            tmp = textBox12.TextOrDefault();
            if (tmp == null)
            {
                return(false);
            }
            editClient.Adres = tmp;

            tmp = TelefonTBoxEDKlienta.TextOrDefault();
            if (tmp == null || tmp.Length < 9)
            {
                return(false);
            }
            editClient.Telefon = tmp;

            editClient.Email = textBox16.TextOrDefault();

            tmp = textBox18.TextOrDefault();
            if (tmp == null)
            {
                return(false);
            }
            editClient.Haslo = tmp;

            editClient.KATEGORIEPJAZDY = new List <KATEGORIEPJAZDY>();
            for (int i = 0; i < checkedListBox3.CheckedIndices.Count; i++)
            {
                var index = checkedListBox3.CheckedIndices[i] + 1;
                editClient.KATEGORIEPJAZDY.Add(new KATEGORIEPJAZDY()
                {
                    idKatPJ = index
                });
            }

            return(true);
        }
Пример #2
0
        private bool LoadClientFromEditScreen(KLIENCI editClient)
        {
            var tmp = ImieTBoxEDKlienta.TextOrDefault();

            if (tmp == null)
            {
                return(false);
            }
            editClient.Imie = tmp;

            editClient.DrugieImie = DrugieImieTBoxEDKlienta.TextOrDefault();

            tmp = NazwiskoTBoxEDKlienta.TextOrDefault();
            if (tmp == null)
            {
                return(false);
            }
            editClient.Nazwisko = tmp;

            tmp = AdresTBoxEDKlienta.TextOrDefault();
            if (tmp == null)
            {
                return(false);
            }
            editClient.Adres = tmp;

            tmp = TelefonTBoxEDKlienta.TextOrDefault();
            if (tmp == null || tmp.Length < 9)
            {
                return(false);
            }
            editClient.Telefon = tmp;

            editClient.Email = EmailTBoxEDKlienta.TextOrDefault();

            tmp = NrPJazdyTBoxEDKlienta.TextOrDefault();
            if (tmp == null || tmp.Length > 13)
            {
                return(false);
            }
            editClient.NrPrawaJazd = tmp;

            tmp = NrDowOsTBoxEDKlienta.TextOrDefault();
            if (tmp == null || tmp.Length > 9)
            {
                return(false);
            }
            editClient.NrDowOsob = tmp;

            editClient.KATEGORIEPJAZDY = new List <KATEGORIEPJAZDY>();
            for (int i = 0; i < KategoriePJazdyCBoxEDKlienta.CheckedIndices.Count; i++)
            {
                var index = KategoriePJazdyCBoxEDKlienta.CheckedIndices[i] + 1;
                editClient.KATEGORIEPJAZDY.Add(new KATEGORIEPJAZDY()
                {
                    idKatPJ = index
                });
            }

            return(true);
        }