Beispiel #1
0
        // login
        private void PANEL_LOGIN_Click(object sender, EventArgs e)
        {
            DataTable table = new DataTable();

            table = log.login(TB_USERNAME.Text, TB_PASSWORD.Text);
            if (table.Rows.Count > 0)
            {
                //if the user is admin
                // => hide the current form and show the home form
                if (table.Rows[0][3].ToString() == "admin")
                {
                    this.Hide();
                    ERP_DashBoard FH = new ERP_DashBoard();
                    //FORM_HOME FH = new FORM_HOME();
                    FH.Closed += (s, args) => this.Close();
                    FH.Show();
                }
                //else the user is not an admin
                // => hide the current form and show the home form
                // => and don't show the user tab
                // => a simple user cannot see the user tab
                else
                {
                    this.Hide();
                    // FORM_HOME FH = new FORM_HOME();
                    ERP_DashBoard FH = new ERP_DashBoard();
                    FH.Closed += (s, args) => this.Close();
                    //FH.userToolStripMenuItem.Visible = false;
                    FH.Show();
                }
            }
            else
            {
                MessageBox.Show("Username Or Password Are Incorrect");
            }
        }
Beispiel #2
0
        private void ButtonX1_Click(object sender, EventArgs e)
        {
            ERP_DashBoard fmp = new ERP_DashBoard();

            fmp.ShowDialog();
        }