Beispiel #1
0
        private void back_bttn_Click(object sender, EventArgs e)
        {
            this.Hide();
            Welcome_Admin myadmin = new Welcome_Admin();

            myadmin.Show();
        }
Beispiel #2
0
        private void cancel_Bttn_Click(object sender, EventArgs e)
        {
            this.Close();
            Welcome_Admin newAdmin = new Welcome_Admin();

            newAdmin.Show();
        }
        private void back_bttn_Click(object sender, EventArgs e)
        {
            cnt   = 0;
            count = 0;
            aSerialPort.Close();
            this.Hide();
            Welcome_Admin thisone = new Welcome_Admin();

            thisone.Show();
        }
Beispiel #4
0
 private void enter_bttn_Click(object sender, EventArgs e)
 {
     try
     {
         i = 0;
         myConn.Open();
         string         query         = "SELECT * FROM Login WHERE Username = '******' and Password='******'"; //creates a connection to the database
         DataTable      dt            = new DataTable();
         SqlDataAdapter myDataAdapter = new SqlDataAdapter(query, myConn);
         myDataAdapter.Fill(dt);
         i = Convert.ToInt32(dt.Rows.Count.ToString());
         if (i == 0)
         {
             MessageBox.Show("You have entered wrong Credentials");
         }
         else
         {
             if (usernamecomboBox.Text == "admin")
             {
                 Welcome_Admin myMenu = new Welcome_Admin();
                 this.Hide();
                 myMenu.Show();
             }
             else
             {
                 this.Hide();
                 Cashier_Box cashbox = new Cashier_Box();
                 cashbox.Show();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     myConn.Close();
 }