/*private void button1_Click(object sender, EventArgs e)
         * {
         *
         * }*/

        private void Product_FormClosed(object sender, FormClosedEventArgs e)
        {
            CashierRegisters cr = new CashierRegisters();

            this.Hide();
            cr.Show();
        }
示例#2
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
            CashierRegisters cr = new CashierRegisters();

            cr.Show();
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-9CBGPDG\ASHIRAFZAL;Initial Catalog=PizzaPoint;Integrated Security=True");

            con.Open();
            try
            {
                if (txtLoginID.Text == "user" || txtPass.Text == "pass")
                {
                    CashierRegisters cr = new CashierRegisters();
                    this.Hide();
                    cr.Show();
                }
                else if (txtLoginID.Text == string.Empty || txtPass.Text == string.Empty)
                {
                    MessageBox.Show("Please Enter Username and Password");
                }
                else
                {
                    int            a       = Convert.ToInt16(txtLoginID.Text);
                    SqlDataAdapter adapter = new SqlDataAdapter("SELECT UserLoginID,UserPass from Users where UserLoginID = '" + a + "' and UserPass = '******'", con);
                    DataTable      table   = new DataTable();
                    adapter.Fill(table);
                    if (table.Rows.Count > 0)
                    {
                        CashierRegisters cr = new CashierRegisters();
                        this.Hide();
                        cr.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Username or Password");
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Please enter ID in numeric form or use the default username and password for login",
                                "User Mishandling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            con.Close();
        }
示例#4
0
        private void Order_FormClosed(object sender, FormClosedEventArgs e)
        {
            CashierRegisters cr = new CashierRegisters();

            cr.Show();
        }