コード例 #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 = "";
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: BradAricW/SeniorProject
        public MainForm()
        {
            InitializeComponent();
            //setup page classes and connections
            dbconn = new DBConn();
            conn   = dbconn.Dbsetup();

            login = new LoginPage();
            login.Setup(conn);

            passPage = new PasswordPage();
            passPage.Setup(conn);

            profile = new ProfilePage();
            profile.Setup(conn, eID);

            report = new ReportPage();
            report.Setup(conn);

            edit = new ProjectPage();
            edit.Setup(conn);

            employee = new EmployeePage();
            employee.Setup(conn);
        } //end MainForm