Example #1
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            EmployeeForm EF = new EmployeeForm();

            this.Hide();
            EF.Show();
        }
Example #2
0
        private void BtnConnect_Click(object sender, EventArgs e)
        {
            if (textBoxNick.Text != "ID")
            {
                if (textBoxPass.Text != "KeyPass")
                {
                    UserModel user       = new UserModel();
                    var       validlogin = user.Loginuser(textBoxNick.Text, textBoxPass.Text);
                    if (validlogin == true)
                    {
                        if (UserLoginCache.userAccessLevel == "Employee")
                        {
                            EmployeeForm EF = new EmployeeForm();
                            EF.Show();
                            this.Hide();
                        }
                        else if (UserLoginCache.userAccessLevel == "Master")
                        {
                            MasterForm MF = new MasterForm();
                            MF.Show();
                            this.Hide();
                            //Master's form (CRUD)
                        }
                        else if (UserLoginCache.userAccessLevel == "Guard")
                        {
                            GuardForm GF = new GuardForm();
                            GF.Show();
                            this.Hide();
                            // Search only and key generator form
                        }
                    }
                    else
                    {
                        msgError("Incorrect ID or KeyPass. \nPlease Try Again");

                        textBoxNick.Clear();
                        textBoxPass.Clear();
                        textBoxNick.Focus();
                    }
                }
                else
                {
                    msgError("Please enter KeyPass.");
                }
            }
            else
            {
                msgError("Please enter ID.");
            }
        }