Example #1
0
        private void Home_Load(object sender, EventArgs e)
        {
            /*For employee Status check from Login. 1-admin programmer-Business Owner, 2-Admin staff, 3-Cashier, 4-Framers.
             * Lock Neccessary buttons based on employee Status
             */
            LoginForm frmLogin = new LoginForm(this);

            frmLogin.ShowDialog();
            Global.empId = employeeId.ToString();
            frmInventoryHomePage inventoryHomePage = new frmInventoryHomePage();

            //MessageBox.Show(employeeId.ToString() + " " + employeeStatus.ToString());

            if (employeeStatus == 1)
            {
                salesOrderBtn.Enabled = true;
                salesOrderBtn.Visible = true;
                jOrderBtn.Enabled     = true;
                jOrderBtn.Visible     = true;
                inventoryBtn.Enabled  = true;
                inventoryBtn.Visible  = true;
                empManBtn.Enabled     = true;
                empManBtn.Visible     = true;
            }
            if (employeeStatus == 2)
            {
                salesOrderBtn.Enabled = true;
                salesOrderBtn.Visible = true;
                jOrderBtn.Visible     = true;
                jOrderBtn.Enabled     = true;
                inventoryBtn.Enabled  = true;
                inventoryBtn.Visible  = true;
                empManBtn.Enabled     = true;
                empManBtn.Visible     = true;
            }
            if (employeeStatus == 3)
            {
                salesOrderBtn.Enabled = true;
                salesOrderBtn.Visible = true;
                jOrderBtn.Enabled     = true;
                jOrderBtn.Visible     = true;
                inventoryBtn.Enabled  = false;
                inventoryBtn.Text     = "Not Applicable";
                empManBtn.Enabled     = false;
                empManBtn.Text        = "Not Applicable";
            }
            if (employeeStatus == 4)
            {
                jOrderBtn.Enabled    = false;
                jOrderBtn.Text       = "Not Applicable";
                inventoryBtn.Visible = true;
                inventoryBtn.Enabled = true;
                //inventoryHomePage.btnSupplies.Enabled = false;
                //inventoryHomePage.btnSupplies.Text = "Not Applicable";
                //inventoryHomePage.btnSupplyStockIn.Enabled = false;
                //inventoryHomePage.btnSupplyStockIn.Text = "Not Applicable";
                //inventoryHomePage.btnCustomerAccount.Enabled = false;
                //inventoryHomePage.btnCustomerAccount.Text = "Not Applicable";
            }
        }
Example #2
0
        private void inventoryBtn_Click(object sender, EventArgs e)
        {
            frmInventoryHomePage inventDlg = new frmInventoryHomePage();

            inventDlg.ShowDialog();
        }