Example #1
0
        //unos koseva na terernu
        private void picbDashboardTeren_MouseUp(object sender, MouseEventArgs e)
        {
            Kosevi kos = new Kosevi();

            kos.Set_XY((decimal)e.Location.X,
                       (decimal)e.Location.Y,
                       (decimal)picbDashboardTeren.Height,
                       (decimal)picbDashboardTeren.Width);
            kos.Suter_id  = igrac_odabran.Id;
            kos.Vrsta_sut = 'I';
            //dohvacanje podataka iz forme Kosevi_popup
            try
            {
                using (var form = new Kosevi_popup(picbDashboardTeren.Location.X + e.Location.X,
                                                   picbDashboardTeren.Location.Y + e.Location.Y,
                                                   this.DesktopLocation.X,
                                                   this.DesktopLocation.Y,
                                                   kos))
                {
                    form.ShowDialog();
                    kos.Pogodak = form.Pogodeno_popup;
                    kos.Br_Bod  = form.Bodovi_popup;
                }
                kosevi_lista.Add(kos);
                Change_label("Šut je zabilježen");
            }
            catch (ArgumentException err)
            {
                lblDashboardResult.ForeColor = Color.Red;
                Change_label(Convert.ToString(err));
            }
        }
Example #2
0
        private void picbKoseviTeren_MouseUp(object sender, MouseEventArgs e)
        {
            Kosevi kos = new Kosevi();

            kos.Set_XY((decimal)e.Location.X, (decimal)e.Location.Y, (decimal)picbKoseviTeren.Height, (decimal)picbKoseviTeren.Width);
            if (s == 'E')
            {
                kos.Suter_id = ekipa.Id;
            }
            else if (s == 'I')
            {
                kos.Suter_id = gridView.igrac_id.Id;
            }
            kos.Vrsta_sut = s;
            //koordinate za izracunavanje pozicjie klika
            var X     = picbKoseviTeren.Location.X + e.Location.X;
            var Y     = picbKoseviTeren.Location.Y + e.Location.Y;
            var formX = this.DesktopLocation.X;
            var formY = this.DesktopLocation.Y;

            //salje se na popup fomu
            try
            {
                using (var form = new Kosevi_popup(X, Y, formX, formY, kos))
                {
                    form.ShowDialog();
                    if (form.status == true)
                    {
                        Change_label("Šut je zabilježen");
                    }
                }
            }
            catch (ArgumentException err)
            {
                lblKoseviResult.ForeColor = Color.Red;
                Change_label("greška kod unosa šuta: " + err.ToString());
            }
        }