Example #1
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            //setup Connection object
            dbconn = new DBConn();
            conn   = dbconn.Dbsetup();
            login  = new LoginPage();
            login.Setup(conn);
            employee.Setup(conn);

            /*
             * //QUICK LOGIN
             * emailBox.Text = "*****@*****.**";
             * passBox.Text = "******";
             */
            string email = emailBox.Text;
            string pword = passBox.Text;

            eID = login.Login(email, pword);
            int success;

            if (eID == null)
            {
                success = 0;
            }
            else
            {
                success = 1;
            }
            if (success == 1)
            {
                this.signOutLabel.Visible = true;
                this.loginBG.Visible      = false;
                this.taskbarMenu.Visible  = true;
                this.profileBG.Visible    = true;
                emailBox.Text             = "";

                profile = new ProfilePage();
                profile.Setup(conn, eID);
                profile.GetHours(profileHoursTextBox);
                profile.GetEmail(profileEmailTextBox);
                profile.GetPhone(profilePhoneTextBox);
                profile.ListProjects(profileProjectGrid);
                edit.Setup(conn);
                isAdmin = profile.getAdmin(eID);
                if (isAdmin == true)
                {
                    admin = new AdminPage();
                    admin.Setup(conn);
                    this.adminLabel.Visible = true;
                }
            }
            passBox.Text = "";
        }
Example #2
0
        } //end MainForm

        //BUTTONS

        //Login Buttons
        private void LoginButton_Click(object sender, EventArgs e)
        {
            this.eID = login.Login(emailBox, passBox);

            if (eID == null)
            {
                success = 0;
            }
            else
            {
                success = 1;
            }
            if (success == 1)
            {
                this.signOutLabel.Visible = true;
                this.loginBG.Visible      = false;
                this.taskbarMenu.Visible  = true;
                this.profileBG.Visible    = true;
                emailBox.Text             = "";

                profile = new ProfilePage();
                profile.Setup(conn, eID);
                profile.GetHours(profileHoursTextBox);
                profile.GetEmail(profileEmailTextBox);
                profile.GetPhone(profilePhoneTextBox);
                profile.GetName(profileFNameBox, profileLNameBox);
                profile.ListProjects(profileProjectGrid);
                profile.ListVacations(vacationsGrid);

                isAdmin = profile.GetAdmin();
                if (isAdmin == true)
                {
                    admin = new AdminPage();
                    admin.Setup(conn);
                    this.adminLabel.Visible = true;
                }
            }
            passBox.Text = "";
        } //end login button