Пример #1
0
 private void btnReturn_Click(object sender, EventArgs e)
 {
     //Return to admin Dashboard
     Dashboard.MainDashboard amdb = new Dashboard.MainDashboard();
     amdb.Show();
     this.Hide();
 }
        protected void btnCashierLogin_Click(object sender, EventArgs e)
        {
            query = "select * from users03";
            ds    = fn.getData(query);

            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("No User Exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                query = "select * from users03 where username='******' and pass='******'";
                ds    = fn.getData(query);

                if (ds.Tables[0].Rows.Count != 0)
                {
                    //Extracting User Role
                    String role = ds.Tables[0].Rows[0][1].ToString();
                    //Extracting User ID
                    int userID = int.Parse(ds.Tables[0].Rows[0][0].ToString());

                    if (role == "Cashier")
                    {
                        /*Dashboard.MainDashboard dashboard = new Dashboard.MainDashboard("Cashier",txtCashierUsername.Text, userID);
                         * dashboard.Show();
                         * this.Hide();*/

                        Dashboard.PlaceOrderDashboard plor = new Dashboard.PlaceOrderDashboard();
                        plor.Show();
                        this.Hide();
                    }
                    else if (role == "Admin")
                    {
                        Dashboard.MainDashboard dashboard = new Dashboard.MainDashboard(txtCashierUsername.Text, userID);
                        dashboard.Show();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("No User Exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #3
0
 private void btnReturn_Click(object sender, EventArgs e)
 {
     Dashboard.MainDashboard amdb = new Dashboard.MainDashboard(CurrentUserName, CurrentUserId);
     amdb.Show();
     this.Hide();
 }