コード例 #1
0
        private string GetCorrectAttribute(Skola a, int j)
        {
            switch (j)
            {
            case 0: return(a.id);

            case 1: return(a.naziv);

            case 2: return(a.adresa);

            case 3: return(a.pbroj);

            case 4: return(a.mesto);

            case 5: return(a.opstina);

            case 6: return(a.okrug);

            case 7: return(a.suprava);

            case 8: return(a.www);

            case 9: return(a.tel);

            case 10: return(a.fax);

            case 11: return(a.vrsta);

            case 12: return(a.odeljenja);

            case 13: return(a.gps);

            default: return("");
            }
        }
コード例 #2
0
        private void MainMap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
        {
            Skola res = Core.Skole.Find(skola => skola.Lat == item.Position.Lat && skola.Lon == item.Position.Lng);
            // TO DO: Visualization
            Details det = new Details(res);

            det.ShowDialog();
        }
コード例 #3
0
        private int Compare(Skola a, Skola b)
        {
            int    n = int.Parse(listBox1.Items.Count.ToString()), p, opada, u1 = 0, u2 = 0;
            string us, k;

            string[] array = vocab.GetRow();
            for (int i = 0; i < n; ++i)
            {
                us = listBox1.Items[i].ToString();
                p  = us.LastIndexOf(" ");
                k  = us.Substring(0, p);
                if (us[p + 1] == vocab.increase[0])
                {
                    opada = -1;
                }
                else
                {
                    opada = 1;
                }
                for (int j = 0; j < 13; ++j)
                {
                    if (k == array[j])
                    {
                        if (j == 0 || j == 3 || j == 12)
                        {
                            try
                            {
                                u1 = int.Parse(GetCorrectAttribute(a, j));
                                u2 = int.Parse(GetCorrectAttribute(b, j));
                            }
                            catch { }
                        }
                        else
                        {
                            u1 = string.Compare(GetCorrectAttribute(a, j), GetCorrectAttribute(b, j));
                            u2 = 0;
                        }
                        break;
                    }
                }
                if (u1 > u2)
                {
                    return(-1 * opada);
                }
                else if (u1 < u2)
                {
                    return(opada);
                }
            }
            return(0);
        }
コード例 #4
0
 public Details(Skola skole)
 {
     InitializeComponent();
     this.skole = skole;
     RefreshVocab();
 }