예제 #1
0
        public HlavnaPlochaFutbal(string pHostia, string pDomaci, RiadiaceOknoFutbal pOkno, Databaza pDat, int pId, int pHos, int pDom)
        {
            this.idZapasu    = pId;
            this.iDTimDomaci = pDom;
            this.idTimHostia = pHos;
            dat          = pDat;
            riadiaceOkno = pOkno;
            hostia       = pHostia;
            domaci       = pDomaci;

            InitializeComponent();
        }
예제 #2
0
        private void LStartFutbal_Click(object sender, EventArgs e)
        {
            bool je       = false;
            int  idZapasu = 0;
            int  hos      = dat.ZistiCiJeTim(tBHostia.Text, "Futbal");

            if (hos == 0)
            {
                MessageBox.Show("Tím " + tBHostia.Text + " nebol nájdený.");
            }
            else
            {
                je = true;
            }
            int dom = dat.ZistiCiJeTim(tBDomaci.Text, "Futbal");

            if (dom == 0)
            {
                MessageBox.Show("Tím " + tBDomaci.Text + " nebol nájdený.");
            }
            else if (je)
            {
                idZapasu = dat.PridajZapas(hos, dom);
            }

            string hostia, domaci;

            if (tBHostia.Text.Equals(""))
            {
                hostia = "Hostia";
            }
            else
            {
                hostia = tBHostia.Text;
            }
            if (tBDomaci.Text.Equals(""))
            {
                domaci = "Domáci";
            }
            else
            {
                domaci = tBDomaci.Text;
            }
            this.Visible = false;
            okno         = new RiadiaceOknoFutbal(hostia, domaci, this, dat, idZapasu, hos, dom);
            okno.ShowDialog();
        }