Example #1
0
File: Login.cs Project: i-akwa/Blue
        private void Login_Load(object sender, EventArgs e)
        {
            var userRepo = new UserRepo();

            if (userRepo.CheckForAdmin() == false)
            {
                StaffRegistration staff = new StaffRegistration();
                staff.ShowDialog();
                this.Hide();
            }
        }
Example #2
0
        private void StaffRegistration_Load(object sender, EventArgs e)
        {
            try
            {
                if (userRepo.CheckForAdmin() == false)
                {
                    cboUserType.Items.Add("Admin");
                    menu1.Enabled = false;
                }

                else
                {
                    cboUserType.Items.Add("Admin");
                    cboUserType.Items.Add("SalesPerson");
                    cboUserType.Items.Add("StockKeeper");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.Substring(0, 20));
            }
        }