Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     this.dateTimePickerDatumPutovanja.MinDate = DateTime.Now;
     AdminService.Ekarta_AdminPortClient veza = new AdminService.Ekarta_AdminPortClient();
     string result = veza.getTrase();
     string[] array = result.Split('#');
     int count = array.Count();
     Dictionary<int, string> trase = new Dictionary<int, string>();
     trase.Add(0, "Izaberi...");
     for (int i = 0; i < count - 1; i++)
     {
         string[] elements = array[i].Split('_');
         trase.Add(Convert.ToInt32(elements[0]), elements[1] + " - " + elements[2]);
     }
     this.comboBoxTrasa.DataSource = new BindingSource(trase, null);
     this.comboBoxTrasa.DisplayMember = "Value";
     this.comboBoxTrasa.ValueMember = "Key";
     popuniPopuste();
 }
Ejemplo n.º 2
0
 private void popuniTrase(ComboBox cb)
 {
     AdminService.Ekarta_AdminPortClient veza = new AdminService.Ekarta_AdminPortClient();
     string result = veza.getTrase();
     string[] array = result.Split('#');
     int count = array.Count();
     Dictionary<int, string> trase = new Dictionary<int, string>();
     trase.Add(0, "Izaberi...");
     for (int i = 0; i < count - 1; i++)
     {
         string[] elements = array[i].Split('_');
         trase.Add(Convert.ToInt32(elements[0]), elements[1] + " - " + elements[2]);
     }
     cb.DataSource = new BindingSource(trase, null);
     cb.DisplayMember = "Value";
     cb.ValueMember = "Key";
 }