Example #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            hasDevice = false;
            dc        = new DeviceConnection();
            oc        = new OnlineConnection();

            port_box.Items.Clear();
            string[] ports = dc.getAvailablePorts();
            if (ports == null || ports.Length == 0)
            {
                port_box.Enabled   = false;
                port_label.Enabled = false;
                Connect.Enabled    = false;

                //MetroFramework.MetroMessageBox.Show(this, "No COM port found\nApplication is exiting...", "STOP !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //Application.Exit();
            }
            else
            {
                foreach (string p in ports)
                {
                    port_box.Items.Add(p);
                }
                port_box.SelectedItem = ports[0];
                Connect.Enabled       = true;
            }

            //device_dashboard.Enabled = false;
            tabs.SelectedTab = device_connection;
        }
Example #2
0
 public NewEmployeeForm(DeviceConnection _dc, string cd)
 {
     InitializeComponent();
     oc = new OnlineConnection();
     if (_dc == null || cd == null || cd.Length == 0)
     {
         throw new ArgumentNullException();
     }
     dc = _dc;
     reset();
     deviceBuilding           = cd;
     workingbuildingText.Text = cd;
 }
Example #3
0
 public Employees(OnlineConnection _oc, string _db, DeviceConnection _dc)
 {
     InitializeComponent();
     if (_dc == null || _oc == null)
     {
         throw new ArgumentNullException();
     }
     oc                     = _oc;
     dc                     = _dc;
     deviceBuilding         = _db;
     Label_Wait.Visible     = true;
     dataGrid.Visible       = false;
     dataGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
     //dataGrid.AutoSize = true;
     dataGrid.MultiSelect = false;
 }