Exemple #1
0
        private void buttonIzbrisiRedVoznje_Click(object sender, EventArgs e)
        {
            if (this.comboBoxTrasaIzmeni.SelectedIndex != 0)
            {
                int idRedVoznje = Int32.Parse(this.comboBoxTrasaIzmeni.SelectedValue.ToString());
                AdminService.Ekarta_AdminPortClient veza = new AdminService.Ekarta_AdminPortClient();
                try { veza.unsetRedVoznje(idRedVoznje); }
                catch(Exception ex){}
                this.comboBoxTrasa.SelectedValue = 0;
                this.comboBoxDan.SelectedValue = 0;
                this.textBoxSat.Text = "";
                this.textBoxMinut.Text = "";

                string result = veza.getRedVoznje();
                string[] array = result.Split('#');
                int count = array.Count();
                Dictionary<int, string> redoviVoznje = new Dictionary<int, string>();
                redoviVoznje.Add(0, "Izaberi...");
                string[] niz = new string[100];
                for (int i = 0; i < count - 1; i++)
                {
                    string[] elements = array[i].Split('_');
                    redoviVoznje.Add(Convert.ToInt32(elements[0]), elements[4] + " " + elements[3]);
                }
                this.comboBoxTrasaIzmeni.DataSource = new BindingSource(redoviVoznje, null);
                this.comboBoxTrasaIzmeni.DisplayMember = "Value";
                this.comboBoxTrasaIzmeni.ValueMember = "Key";
            }
            else
            {
                MessageBox.Show("Izaberite red voznje!", "Obavestenje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemple #2
0
 private void popuniRedVoznje()
 {
     AdminService.Ekarta_AdminPortClient veza = new AdminService.Ekarta_AdminPortClient();
     string result = veza.getRedVoznje();
     string[] array = result.Split('#');
     int count = array.Count();
     Dictionary<int, string> redoviVoznje = new Dictionary<int, string>();
     redoviVoznje.Add(0, "Izaberi...");
     string[] niz = new string[100];
     for (int i = 0; i < count - 1; i++)
     {
         string[] elements = array[i].Split('_');
         redoviVoznje.Add(Convert.ToInt32(elements[0]), elements[4] + " " + elements[3]);
     }
     this.comboBoxTrasaIzmeni.DataSource = new BindingSource(redoviVoznje, null);
     this.comboBoxTrasaIzmeni.DisplayMember = "Value";
     this.comboBoxTrasaIzmeni.ValueMember = "Key";
 }