Exemplo n.º 1
0
        protected void GetData()
        {
            Collection <Zakaznik>  zakaznici   = ZakaznikTable.select();
            BindingList <Zakaznik> bindingList = new BindingList <Zakaznik>(zakaznici);

            zakGrid.DataSource = bindingList;
        }
Exemplo n.º 2
0
        private bool GetData()
        {
            Collection <Zakaznik>    zakaznici   = ZakaznikTable.select();
            Collection <Zamestnanec> zamestnanci = ZamestnanecTable.select();
            Collection <Zbran>       zbrane      = ZbranTable.select();
            Collection <Prostor>     prostory    = ProstorTable.select();

            strelba.Zacatek           = dateTimePicker1.Value;
            strelba.Konec             = dateTimePicker2.Value;
            strelba.Zakaznik_idZak    = zakaznici[comboBox1.SelectedIndex].idZak;
            strelba.Zamestnanec_idZam = zamestnanci[comboBox2.SelectedIndex].idZam;
            strelba.Zbran_idZbr       = zbrane[comboBox3.SelectedIndex].idZbr;
            strelba.Prostor_idSpr     = prostory[comboBox4.SelectedIndex].idSpr;
            return(true);
        }
Exemplo n.º 3
0
 public bool OpenRecord(object primaryKey)
 {
     if (primaryKey != null)
     {
         int idZak = (int)primaryKey;
         zakaznik  = ZakaznikTable.select(idZak);
         newRecord = false;
     }
     else
     {
         zakaznik = new Zakaznik();
         zakaznik.Datum_narozeni = new DateTime(2000, 01, 01);
         newRecord = true;
     }
     BindData();
     return(true);
 }
Exemplo n.º 4
0
        private void BindData()
        {
            Collection <Zakaznik>    zakaznici   = ZakaznikTable.select();
            Collection <Zamestnanec> zamestnanci = ZamestnanecTable.select();
            Collection <Zbran>       zbrane      = ZbranTable.select();
            Collection <Prostor>     prostory    = ProstorTable.select();

            foreach (Zakaznik zakaznik in zakaznici)
            {
                comboBox1.Items.Add(zakaznik.Jmeno + " " + zakaznik.Prijmeni);
                if (zakaznik.idZak == strelba.Zakaznik_idZak)
                {
                    comboBox1.SelectedIndex = comboBox1.Items.Count - 1;
                }
            }

            foreach (Zamestnanec zamestnanec in zamestnanci)
            {
                comboBox2.Items.Add(zamestnanec.Jmeno + " " + zamestnanec.Prijmeni);
                if (zamestnanec.idZam == strelba.Zamestnanec_idZam)
                {
                    comboBox2.SelectedIndex = comboBox2.Items.Count - 1;
                }
            }

            foreach (Zbran zbran in zbrane)
            {
                comboBox3.Items.Add(zbran.Nazev);
                if (zbran.idZbr == strelba.Zbran_idZbr)
                {
                    comboBox3.SelectedIndex = comboBox3.Items.Count - 1;
                }
            }

            foreach (Prostor prostor in prostory)
            {
                comboBox4.Items.Add(prostor.idSpr.ToString() + " " + prostor.vzdalenost.ToString());
                if (prostor.idSpr == strelba.Prostor_idSpr)
                {
                    comboBox4.SelectedIndex = comboBox4.Items.Count - 1;
                }
            }

            dateTimePicker1.Value = strelba.Zacatek;
            dateTimePicker2.Value = strelba.Konec;
        }
Exemplo n.º 5
0
        private bool GetData()
        {
            Collection <Zakaznik> zakaznici = ZakaznikTable.select();
            Collection <Zbran>    zbrane    = ZbranTable.select();
            Collection <Prostor>  prostory  = ProstorTable.select();

            if (comboBox1.SelectedIndex >= 0 && comboBox2.SelectedIndex >= 0 && comboBox3.SelectedIndex >= 0)
            {
                rezervace.datumVytvoreni = DateTime.Now;
                rezervace.datumStrelby   = dateTimePicker2.Value;
                rezervace.Zakaznik_idZak = zakaznici[comboBox1.SelectedIndex].idZak;
                rezervace.Zbran_idZbr    = zbrane[comboBox2.SelectedIndex].idZbr;
                rezervace.Prostor_idSpr  = prostory[comboBox3.SelectedIndex].idSpr;
                label2.Visible           = false;
                return(true);
            }

            else
            {
                label2.Visible = true;
                return(false);
            }
        }
Exemplo n.º 6
0
        private void BindData()
        {
            Collection <Zakaznik> zakaznici = ZakaznikTable.select();
            Collection <Zbran>    zbrane    = ZbranTable.select();
            Collection <Prostor>  prostory  = ProstorTable.select();

            foreach (Zakaznik zakaznik in zakaznici)
            {
                comboBox1.Items.Add(zakaznik.Jmeno + " " + zakaznik.Prijmeni);
            }

            foreach (Zbran zbran in zbrane)
            {
                comboBox2.Items.Add(zbran.Nazev);
            }

            foreach (Prostor prostor in prostory)
            {
                comboBox3.Items.Add(prostor.idSpr.ToString() + " " + prostor.vzdalenost.ToString());
            }

            dateTimePicker2.Value = rezervace.datumStrelby;
        }