Exemplo n.º 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            loggedOut();
            LoginProgram loginForm = new LoginProgram();

            loginForm.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void Main_Load(object sender, EventArgs e)
        {
            using (LoginProgram login = new LoginProgram())
            {
                login.loggedIn += new EventHandler(login_loggedIn);
                staffName       = login.getSName();
                staffNumber     = login.getSNumber();
                staffPassword   = login.getSPassword();
                staffTye        = login.getSType();
                staffUsername   = login.getSUsername();
            }
            LsName.Text = staffTye;
            label1.Text = "Name: " + staffName;
            label2.Text = "Stuff Number: " + staffNumber;
            try
            {
                userImage.Image = Image.FromFile(executionPath + @"\StaffImages\" + staffNumber + ".bmp");
            }
            catch (Exception)
            {
                userImage.Visible = false;
            }

            switch (staffTye)
            {
            case "Admin":
                afterLogin();
                break;

            case "NoBody":
                beforeLogin();
                MessageBox.Show("Dear " + staffName + " Please login again after the manager gives you privelages to use the system");
                break;

            case "User":
                userLogin();
                break;

            default:
                beforeLogin();
                MessageBox.Show("User cannot be identified, If you are trying to hack the System... \nSorry There isn't much you can do here");
                break;
            }
        }