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 AddHolidayForm(OnlineConnection _oc)
 {
     InitializeComponent();
     if (_oc == null)
     {
         throw new ArgumentNullException();
     }
     oc = _oc;
 }
Example #3
0
 public GrantLeave(OnlineConnection _oc, string _id)
 {
     InitializeComponent();
     if (_oc == null || _id.Length == 0)
     {
         throw new ArgumentNullException();
     }
     oc  = _oc;
     fid = _id;
 }
Example #4
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 #5
0
 public EditHolidayForm(OnlineConnection _oc, int _id, string _name, string _start, string _end)
 {
     InitializeComponent();
     if (id < 0 || _oc == null || _name.Length == 0 || _start.Length == 0 || _end.Length == 0)
     {
         throw new ArgumentNullException();
     }
     oc                      = _oc;
     id                      = _id;
     name_text.Text          = _name;
     sMonthBox.SelectedIndex = Convert.ToInt32(_start.Substring(3)) - 1;
     eMonthBox.SelectedIndex = Convert.ToInt32(_end.Substring(3)) - 1;
     sDateBox.Text           = _start.Substring(0, 2);
     eDateBox.Text           = _end.Substring(0, 2);
 }
Example #6
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;
 }
Example #7
0
        public UpdateUserForm(OnlineConnection _oc, int _id, string _name, string _sex, string _address, string _rank, string _s, string _e, string _h)
        {
            InitializeComponent();
            if (_oc == null || id < 0)
            {
                throw new ArgumentNullException();
            }
            oc                = _oc;
            id                = _id;
            name_text.Text    = _name;
            address_text.Text = _address;
            rank_text.Text    = _rank;
            if (_sex == "Male")
            {
                Male_Radio.Checked = true;
            }
            else if (_sex == "Female")
            {
                Female_Radio.Checked = true;
            }
            else
            {
                Other_Radio.Checked = true;
            }
            shiftStart.Text = _s;
            shiftEnd.Text   = _e;

            holis = _h;

            if (holis == "56")
            {
                holicheck.Checked = true;
                holicheck.Text    = "Default Weekly Holidays ( Friday and Saterday )";
            }
            else
            {
                holicheck.Checked = false;
                holicheck.Text    = "Custom weekly holidays selected";
            }

            isInit = false;
        }