Example #1
0
 private void initUI()
 {
     listRouter.Items.Clear();
     foreach (var value in _listRouter)
     {
         if (BUtils.isNotNull(value.Value.Stations1) && value.Value.Stations1.Count != 0)
         {
             listRouter.Items.Add(value.Value.RouterId + "_0");
         }
         if (BUtils.isNotNull(value.Value.Stations2) && value.Value.Stations2.Count != 0)
         {
             listRouter.Items.Add(value.Value.RouterId + "_1");
         }
     }
 }
Example #2
0
        /**
         * Import bus router file
         */
        private void btnImportClick(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter      = "Json file (.json)|*.json|All file (*.*)|*.*";
            dialog.FilterIndex = 1;
            dialog.Multiselect = true;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                String[] filenames = dialog.FileNames;
                BUtils.loadFormFiles(filenames, _listRouter, _listStation, _listPath);
                MessageBox.Show("Import successfull", "Info", MessageBoxButtons.OK);

                initUI();
            }
        }