Example #1
0
        private void btnFiltriraj_Click(object sender, EventArgs e)
        {
            Nullable <Gimnastika> gimnastika = null;

            if (cmbGimnastika.SelectedIndex == cmbGimnastika.Items.IndexOf(MSG))
            {
                gimnastika = Gimnastika.MSG;
            }
            else if (cmbGimnastika.SelectedIndex == cmbGimnastika.Items.IndexOf(ZSG))
            {
                gimnastika = Gimnastika.ZSG;
            }
            string klub = cmbKlub.SelectedItem as string;

            if (klub == SVI_KLUBOVI)
            {
                klub = String.Empty;
            }

            GimnasticarBiltenDAO dao = new GimnasticarBiltenDAO();

            dao.ConnectionString = Opcije.Instance.BiltenConnectionString;
            IList <GimnasticarBilten> gimnasticari = dao.findGimnasticariBilten(txtIme.Text.Trim(), txtPrezime.Text.Trim(),
                                                                                gimnastika, klub);

            dataGridViewUserControl1.setItems <GimnasticarBilten>(gimnasticari);
            if (gimnasticari.Count == 0)
            {
                MessageDialogs.showMessage("Ne postoje gimnasticari koji zadovoljavaju date kriterijume", this.Text);
            }
            dataGridViewUserControl1.clearSelection();
        }
Example #2
0
        public virtual void Edit()
        {
            if (SelectedItem == null)
            {
                return;
            }
            int index = dataGridViewUserControl1.getSelectedItemIndex();

            try
            {
                EntityDetailForm form = createEntityDetailForm(getEntityId(SelectedItem));
                if (form.ShowDialog() == DialogResult.OK)
                {
                    T        entity = (T)form.Entity;
                    List <T> items  = dataGridViewUserControl1.getItems <T>();
                    items[index] = entity;
                    dataGridViewUserControl1.setItems <T>(items);  // ovo ponovo sortira items
                    dataGridViewUserControl1.setSelectedItem <T>(entity);
                }
            }
            catch (InfrastructureException ex)
            {
                MessageDialogs.showError(ex.Message, this.Text);
            }
        }
Example #3
0
        private void btnDodajIzvodMKR_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string fileName      = Path.GetFileName(ofd.FileName);
            string fileDirectory = Path.GetDirectoryName(ofd.FileName);
            string appDirectory  = AppDomain.CurrentDomain.BaseDirectory;
            string destDirectory = Path.Combine(appDirectory, ConfigurationParameters.IzvodiMKRFolder);

            bool   fileIsInDestDirectory = fileDirectory.ToUpper() == destDirectory.ToUpper();
            string newPath = Path.Combine(appDirectory, ConfigurationParameters.IzvodiMKRFolder, fileName);

            if (!fileIsInDestDirectory && File.Exists(newPath))
            {
                // Izabran je fajl van odredisnog foldera, a u odredisnom folderu vec postoji fajl sa istim imenom.
                // Nemoj da kopiras da ne bi prebrisao stari fajl.
                MessageDialogs.showError(String.Format("Fajl sa identicnim imenom ('{0}') vec postoji u folderu {1}.", fileName,
                                                       ConfigurationParameters.IzvodiMKRFolder), this.Text);
            }
            else
            {
                // Kopiraj samo ako je izabran fajl van odredisnog direktorijuma
                if (!fileIsInDestDirectory)
                {
                    File.Copy(ofd.FileName, newPath);
                }
                txtIzvodMKR.Text = fileName;
            }
        }
Example #4
0
        private void deleteCommand()
        {
            if (SelectedItem == null)
            {
                return;
            }
            if (!MessageDialogs.queryConfirmation(deleteConfirmationMessage(SelectedItem), this.Text))
            {
                return;
            }

            ISession session = null;
            bool     ok      = false;

            try
            {
                using (session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);
                        if (refIntegrityDeleteDlg(SelectedItem))
                        {
                            delete(SelectedItem);
                            session.Transaction.Commit();
                            ok = true;
                        }
                    }
            }
            catch (Exception ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                MessageDialogs.showError(
                    String.Format("{0} \n\n{1}", deleteErrorMessage(), ex.Message),
                    this.Text);
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }

            if (ok)
            {
                List <T> items = dataGridViewUserControl1.getItems <T>();
                items.Remove(SelectedItem);
                CurrencyManager currencyManager =
                    (CurrencyManager)this.BindingContext[dataGridViewUserControl1.DataGridView.DataSource];
                currencyManager.Refresh();
                updateEntityCount();
            }
        }
Example #5
0
 private void mnTreneri_Click(object sender, EventArgs e)
 {
     try
     {
         TreneriForm form = new TreneriForm();
         form.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #6
0
 private void mnKategorijeGimnasticara_Click(object sender, EventArgs e)
 {
     try
     {
         KategorijeGimnasticaraForm form = new KategorijeGimnasticaraForm();
         form.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #7
0
 protected override bool refIntegrityDeleteDlg(Klub klub)
 {
     if (!DAOFactoryFactory.DAOFactory.GetGimnasticarDAO().existsGimnasticar(klub))
     {
         return(true);
     }
     else
     {
         string msg = "Postoje gimnasticari koji su clanovi kluba '{0}'. Ako " +
                      "ga izbrisete, ovi gimnasticari nece imati naveden klub. " +
                      "Da li zelite da izbrisete klub?";
         return(MessageDialogs.queryConfirmation(String.Format(msg, klub), this.Text));
     }
 }
 protected override bool refIntegrityDeleteDlg(KategorijaGimnasticara kategorija)
 {
     if (!DAOFactoryFactory.DAOFactory.GetGimnasticarDAO().existsGimnasticar(kategorija))
     {
         return(true);
     }
     else
     {
         string msg = "Postoje gimnasticari kategorije '{0}'. Ako " +
                      "je izbrisete, ovi gimnasticari nece imati navedenu kategoriju. " +
                      "Da li zelite da izbrisete kategoriju?";
         return(MessageDialogs.queryConfirmation(String.Format(msg, kategorija), this.Text));
     }
 }
Example #9
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (dataGridViewUserControl1.DataGridView.SelectedRows.Count == 0)
            {
                MessageDialogs.showMessage("Selektujte gimnasticare", this.Text);
                DialogResult = DialogResult.None;
                return;
            }

            SelektovaniGimnasticari.Clear();
            foreach (DataGridViewRow row in dataGridViewUserControl1.DataGridView.SelectedRows)
            {
                SelektovaniGimnasticari.Add(row.DataBoundItem as GimnasticarBilten);
            }
        }
Example #10
0
 private void mnGimnasticari_Click(object sender, EventArgs e)
 {
     try
     {
         GimnasticariForm form = new GimnasticariForm();
         form.ShowDialog();
     }
     catch (Exception ex)
     {
         // NOTE: Izuzetak moze da potice samo iz konstruktora. Kada se form
         // uspesno kreira i prikaze pozivom ShowDialog (ili Show), tada se
         // izuzetci unutar forma ne propagiraju do koda koji je pozvao
         // ShowDialog.
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #11
0
        private void btnPrikaziIzvodMKR_Click(object sender, EventArgs e)
        {
            string fileName = txtIzvodMKR.Text.Trim();

            if (!String.IsNullOrEmpty(fileName))
            {
                string path = Path.Combine(ConfigurationParameters.IzvodiMKRFolder, fileName);
                if (!File.Exists(path))
                {
                    MessageDialogs.showMessage(String.Format("Fajl {0} ne postoji u folderu {1}.", Path.GetFileName(fileName),
                                                             ConfigurationParameters.IzvodiMKRFolder), this.Text);
                }
                else
                {
                    System.Diagnostics.Process.Start(path);
                }
            }
        }
Example #12
0
 private void btnAddKlub_Click(object sender, EventArgs e)
 {
     try
     {
         KlubForm form = new KlubForm(null);
         if (form.ShowDialog() == DialogResult.OK)
         {
             Klub k = (Klub)form.Entity;
             klubovi.Add(k);
             klubovi.Sort();
             setKlubovi(klubovi);
             SelectedKlub = k;
         }
     }
     catch (InfrastructureException ex)
     {
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #13
0
        private void reloadKategorije()
        {
            Nullable <Gimnastika> gim = null;

            if (cmbGimnastika.SelectedIndex == cmbGimnastika.Items.IndexOf(MSG))
            {
                gim = Gimnastika.MSG;
            }
            else if (cmbGimnastika.SelectedIndex == cmbGimnastika.Items.IndexOf(ZSG))
            {
                gim = Gimnastika.ZSG;
            }

            ISession session = null;

            try
            {
                using (session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);
                        kategorije = new List <KategorijaGimnasticara>(loadKategorije(gim));
                        setKategorije();
                    }
            }
            catch (Exception ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                MessageDialogs.showMessage(
                    Strings.getFullDatabaseAccessExceptionMessage(ex), this.Text);

                // TODO: Ovde bi nekako trebalo zatvoriti form na kome se nalazi
                // ova user kontrola
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }
        }
Example #14
0
 protected virtual void AddNew()
 {
     try
     {
         EntityDetailForm form = createEntityDetailForm(null);
         if (form.ShowDialog() == DialogResult.OK)
         {
             T        newEntity = (T)form.Entity;
             List <T> items     = dataGridViewUserControl1.getItems <T>();
             items.Add(newEntity);
             dataGridViewUserControl1.setItems <T>(items);
             dataGridViewUserControl1.setSelectedItem <T>(newEntity);
             updateEntityCount();
         }
     }
     catch (InfrastructureException ex)
     {
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #15
0
        public override void Edit()
        {
            if (SelectedItem == null)
            {
                return;
            }
            int index = dataGridViewUserControl1.getSelectedItemIndex();

            try
            {
                GimnasticarForm form = (GimnasticarForm)createEntityDetailForm(SelectedItem.Id);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (form.GimnasticarToEdit == null)
                    {
                        Gimnasticar        entity = (Gimnasticar)form.Entity;
                        List <Gimnasticar> items  = dataGridViewUserControl1.getItems <Gimnasticar>();
                        items[index] = entity;
                        dataGridViewUserControl1.setItems <Gimnasticar>(items);  // ovo ponovo sortira items
                        dataGridViewUserControl1.setSelectedItem <Gimnasticar>(entity);
                    }
                    else
                    {
                        List <Gimnasticar> items = dataGridViewUserControl1.getItems <Gimnasticar>();
                        Gimnasticar        g     = form.GimnasticarToEdit;
                        if (items.IndexOf(g) == -1)
                        {
                            items.Add(g);
                            dataGridViewUserControl1.setItems <Gimnasticar>(items);
                            updateEntityCount();
                        }
                        dataGridViewUserControl1.setSelectedItem <Gimnasticar>(g);
                        Edit(g);
                    }
                }
            }
            catch (InfrastructureException ex)
            {
                MessageDialogs.showError(ex.Message, this.Text);
            }
        }
Example #16
0
        protected override void onApplyFilter()
        {
            if (filterForm == null || filterForm.IsDisposed)
            {
                // NOTE: IsDisposed je true kada se form zatvori (bilo pritiskom na X
                // ili pozivom Close)

                try
                {
                    filterForm         = new FilterGimnasticarForm(null); // can throw
                    filterForm.Filter += new EventHandler(filterForm_Filter);
                    filterForm.Show();
                }
                catch (InfrastructureException ex)
                {
                    MessageDialogs.showError(ex.Message, this.Text);
                }
            }
            else
            {
                filterForm.Activate();
            }
        }
Example #17
0
 protected override void AddNew()
 {
     try
     {
         GimnasticarForm form = (GimnasticarForm)createEntityDetailForm(null);
         if (form.ShowDialog() == DialogResult.OK)
         {
             if (form.GimnasticarToEdit == null)
             {
                 Gimnasticar        newEntity = (Gimnasticar)form.Entity;
                 List <Gimnasticar> items     = dataGridViewUserControl1.getItems <Gimnasticar>();
                 items.Add(newEntity);
                 dataGridViewUserControl1.setItems <Gimnasticar>(items);
                 dataGridViewUserControl1.setSelectedItem <Gimnasticar>(newEntity);
                 updateEntityCount();
             }
             else
             {
                 List <Gimnasticar> items = dataGridViewUserControl1.getItems <Gimnasticar>();
                 Gimnasticar        g     = form.GimnasticarToEdit;
                 if (items.IndexOf(g) == -1)
                 {
                     items.Add(g);
                     dataGridViewUserControl1.setItems <Gimnasticar>(items);
                     updateEntityCount();
                 }
                 dataGridViewUserControl1.setSelectedItem <Gimnasticar>(g);
                 Edit(g);
             }
         }
     }
     catch (InfrastructureException ex)
     {
         MessageDialogs.showError(ex.Message, this.Text);
     }
 }
Example #18
0
        private bool validateFilter()
        {
            Notification notification = new Notification();
            int          dummyInt;

            if (txtGodRodj.Text.Trim() != String.Empty &&
                !int.TryParse(txtGodRodj.Text, out dummyInt))
            {
                notification.RegisterMessage(
                    "GodinaRodjenja", "Neispravan format za godinu rodjenja.");
            }
            if (!notification.IsValid())
            {
                NotificationMessage msg = notification.FirstMessage;
                // TODO: this.Text nije inicijalizovan
                MessageDialogs.showMessage(msg.Message, this.Text);
                setFocus(msg.FieldName);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #19
0
        protected virtual void handleOkClick()
        {
            if (showWaitCursor)
            {
                Cursor.Current = Cursors.WaitCursor;
                Cursor.Show();
            }

            ISession session = null;

            try
            {
                using (session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);
                        Notification notification = new Notification();
                        requiredFieldsAndFormatValidation(notification);
                        if (!notification.IsValid())
                        {
                            throw new BusinessException(notification);
                        }

                        if (editMode)
                        {
                            update();
                        }
                        else
                        {
                            add();
                        }

                        if (persistEntity)
                        {
                            session.Transaction.Commit();
                        }
                        closedByOK = true;
                    }
            }
            catch (BusinessException ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                if (ex.Notification != null)
                {
                    NotificationMessage msg = ex.Notification.FirstMessage;
                    MessageDialogs.showMessage(msg.Message, this.Text);
                    setFocus(msg.FieldName);
                }
                else if (!string.IsNullOrEmpty(ex.InvalidProperty))
                {
                    MessageDialogs.showMessage(ex.Message, this.Text);
                    setFocus(ex.InvalidProperty);
                }
                else
                {
                    MessageDialogs.showMessage(ex.Message, this.Text);
                }
                this.DialogResult = DialogResult.None;
            }

            /*catch (StaleObjectStateException staleEx)
             * {
             *  // TODO: This implementation does not implement optimistic concurrency
             *  // control. Your application will not work until you add compensation
             *  // actions. Rollback, close everything, possibly compensate for any
             *  // permanent changes during the conversation, and finally restart
             *  // business conversation. Maybe give the user of the application a
             *  // chance to merge some of his work with fresh data... what you do
             *  // here depends on your applications design.
             *
             *  throw staleEx;
             * }*/
            catch (Exception ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                MessageDialogs.showError(
                    Strings.getFullDatabaseAccessExceptionMessage(ex), this.Text);
                this.DialogResult = DialogResult.Cancel;
                discardChanges();
                closedByCancel = true;
            }
            finally
            {
                if (showWaitCursor)
                {
                    Cursor.Hide();
                    Cursor.Current = Cursors.Arrow;
                }
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }
        }
Example #20
0
        private void filter(object filterObject)
        {
            GimnasticarFilter flt = filterObject as GimnasticarFilter;

            if (flt == null)
            {
                return;
            }

            ISession session = null;

            try
            {
                using (session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);

                        // biranje gimnasticara sa prethodnog takmicenja
                        //Takmicenje takmicenje = dataContext.GetById<Takmicenje>(5);
                        //gimnasticari = dataContext.ExecuteNamedQuery<Gimnasticar>(
                        //    "FindGimnasticariByTakmicenje",
                        //    new string[] { "takmicenje" }, new object[] { takmicenje });

                        IList <Gimnasticar> gimnasticari;
                        string failureMsg = "";
                        if (!String.IsNullOrEmpty(flt.RegBroj))
                        {
                            gimnasticari = DAOFactoryFactory.DAOFactory.GetGimnasticarDAO().FindGimnasticariByRegBroj(flt.RegBroj);
                            if (gimnasticari.Count == 0)
                            {
                                failureMsg = "Ne postoji gimnasticar sa datim registarskim brojem.";
                            }
                        }
                        else
                        {
                            gimnasticari = DAOFactoryFactory.DAOFactory.GetGimnasticarDAO().FindGimnasticari(flt.Ime,
                                                                                                             flt.Prezime, flt.GodRodj, flt.Gimnastika, flt.Kategorija, flt.Klub);
                            if (gimnasticari.Count == 0)
                            {
                                failureMsg = "Ne postoje gimnasticari koji zadovoljavaju date kriterijume.";
                            }
                        }
                        SetItems(gimnasticari);
                        updateEntityCount();
                        if (gimnasticari.Count == 0)
                        {
                            MessageDialogs.showMessage(failureMsg, this.Text);
                        }
                    }
            }
            catch (Exception ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                MessageDialogs.showError(
                    Strings.getFullDatabaseAccessExceptionMessage(ex), this.Text);
            }
            finally
            {
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }
        }
Example #21
0
        void btnUveziIzBiltena_Click(object sender, EventArgs e)
        {
            if (Opcije.Instance.BiltenConnectionString == null)
            {
                MessageDialogs.showMessage("Pronadjite folder za bilten i selektujte fajl 'BiltenPodaci.sdf'.", "Registracija");
                OpenFileDialog ofd = new OpenFileDialog();
                if (ofd.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                Opcije.Instance.BiltenConnectionString = String.Format(@"Data Source={0}", ofd.FileName);
            }

            SelectGimnasticarBiltenForm form = new SelectGimnasticarBiltenForm();

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            IList <Gimnasticar> noviGimnasticari = new List <Gimnasticar>();

            Cursor.Current = Cursors.WaitCursor;
            Cursor.Show();
            bool     ok      = false;
            ISession session = null;

            try
            {
                using (session = NHibernateHelper.Instance.OpenSession())
                    using (session.BeginTransaction())
                    {
                        CurrentSessionContext.Bind(session);
                        GimnasticarDAO gimDAO = DAOFactoryFactory.DAOFactory.GetGimnasticarDAO();

                        KlubDAO klubDAO = DAOFactoryFactory.DAOFactory.GetKlubDAO();
                        KategorijaGimnasticaraDAO katDAO = DAOFactoryFactory.DAOFactory.GetKategorijaGimnasticaraDAO();

                        IDictionary <Klub, Klub> klubovi = new Dictionary <Klub, Klub>();
                        foreach (Klub k in klubDAO.FindAll())
                        {
                            klubovi.Add(k, k);
                        }
                        IDictionary <KategorijaGimnasticara, KategorijaGimnasticara> kategorije
                            = new Dictionary <KategorijaGimnasticara, KategorijaGimnasticara>();
                        foreach (KategorijaGimnasticara kat in katDAO.FindAll())
                        {
                            kategorije.Add(kat, kat);
                        }

                        foreach (GimnasticarBilten g in form.SelektovaniGimnasticari)
                        {
                            if (!gimDAO.existsGimnasticarImePrezimeSrednjeImeDatumRodjenja(g.Ime, g.Prezime, g.SrednjeIme,
                                                                                           g.DatumRodjenja))
                            {
                                Gimnasticar gim = createGimnasticar(g, klubDAO, katDAO, klubovi, kategorije);
                                noviGimnasticari.Add(gim);
                                gimDAO.Add(gim);
                            }
                        }

                        session.Transaction.Commit();
                        ok = true;
                    }
            }
            catch (Exception ex)
            {
                if (session != null && session.Transaction != null && session.Transaction.IsActive)
                {
                    session.Transaction.Rollback();
                }
                throw new InfrastructureException(ex.Message, ex);
            }
            finally
            {
                Cursor.Hide();
                Cursor.Current = Cursors.Arrow;
                CurrentSessionContext.Unbind(NHibernateHelper.Instance.SessionFactory);
            }

            if (ok)
            {
                List <Gimnasticar> items = dataGridViewUserControl1.getItems <Gimnasticar>();
                foreach (Gimnasticar g in noviGimnasticari)
                {
                    items.Add(g);
                }
                dataGridViewUserControl1.setItems <Gimnasticar>(items);
                dataGridViewUserControl1.clearSelection();
                updateEntityCount();
            }
        }
Example #22
0
        void btnRezultati_Click(object sender, EventArgs e)
        {
            if (SelectedItem == null)
            {
                return;
            }

            if (Opcije.Instance.BiltenConnectionString == null)
            {
                MessageDialogs.showMessage("Pronadjite folder za bilten i selektujte fajl 'BiltenPodaci.sdf'.", "Registracija");
                OpenFileDialog ofd = new OpenFileDialog();
                if (ofd.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                Opcije.Instance.BiltenConnectionString = String.Format(@"Data Source={0}", ofd.FileName);
            }

            KonacanPlasmanDAO kpDAO = new KonacanPlasmanDAO();

            kpDAO.ConnectionString = Opcije.Instance.BiltenConnectionString;

            Cursor.Current = Cursors.WaitCursor;
            Cursor.Show();
            List <KonacanPlasman> plasmani;

            try
            {
                List <KonacanPlasman> viseboj = new List <KonacanPlasman>();
                viseboj.AddRange(kpDAO.findVisebojFinaleKupa(SelectedItem.Ime, SelectedItem.Prezime));
                viseboj.AddRange(kpDAO.findVisebojZbirViseKola(SelectedItem.Ime, SelectedItem.Prezime));
                viseboj.AddRange(kpDAO.findVisebojTak1(SelectedItem.Ime, SelectedItem.Prezime));
                viseboj.AddRange(kpDAO.findVisebojTak2(SelectedItem.Ime, SelectedItem.Prezime));

                List <KonacanPlasman> sprave = new List <KonacanPlasman>();
                // Dodajem najpre finale kupa da bi, ako je postojalo odvojeno takmicenje 3 finale kupa, rezultati prebrisali
                // ove rezultate (za one gimnasticare koji su ucestvovali u odvojenom finalu kupa). Iz istog razloga najpre
                // dodajem spraveTak1 pa spraveTak3.
                sprave.AddRange(kpDAO.findSpraveFinaleKupa(SelectedItem.Ime, SelectedItem.Prezime));
                sprave.AddRange(kpDAO.findSpraveTak1(SelectedItem.Ime, SelectedItem.Prezime));
                sprave.AddRange(kpDAO.findSpraveTak3(SelectedItem.Ime, SelectedItem.Prezime));
                sprave.AddRange(kpDAO.findPreskokTak1(SelectedItem.Ime, SelectedItem.Prezime));
                sprave.AddRange(kpDAO.findPreskokTak3(SelectedItem.Ime, SelectedItem.Prezime));

                Dictionary <int, KonacanPlasman> plasmaniMap = new Dictionary <int, KonacanPlasman>();
                foreach (KonacanPlasman kp in viseboj)
                {
                    if (plasmaniMap.ContainsKey(kp.RezultatskoTakmicenjeId))
                    {
                        if (kp.Viseboj != null)
                        {
                            plasmaniMap[kp.RezultatskoTakmicenjeId].Viseboj = kp.Viseboj;
                        }
                    }
                    else
                    {
                        plasmaniMap.Add(kp.RezultatskoTakmicenjeId, kp);
                    }
                }
                foreach (KonacanPlasman kp in sprave)
                {
                    if (plasmaniMap.ContainsKey(kp.RezultatskoTakmicenjeId))
                    {
                        updatePlasmanSprava(plasmaniMap[kp.RezultatskoTakmicenjeId], kp);
                    }
                    else
                    {
                        plasmaniMap.Add(kp.RezultatskoTakmicenjeId, kp);
                    }
                }

                plasmani = new List <KonacanPlasman>(plasmaniMap.Values);
            }
            finally
            {
                Cursor.Hide();
                Cursor.Current = Cursors.Arrow;
            }

            if (plasmani.Count == 0)
            {
                MessageDialogs.showMessage("Ne postoje rezultati za gimnasticara '" +
                                           SelectedItem.ImeSrednjeImePrezimeDatumRodjenja + "'.", "Rezultati");
            }
            else
            {
                KonacanPlasmanForm form = new KonacanPlasmanForm(plasmani, SelectedItem.Gimnastika);
                form.ShowDialog();
            }
        }