private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            ProductForm product = new ProductForm();

            product.Show();
            this.Hide();
        }
示例#2
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (usernameTb.Text == "" || userpasstb.Text == "")
     {
         MessageBox.Show("Enter the Username and Password ");
     }
     else
     {
         if (logCb.SelectedIndex > -1)
         {
             if (logCb.SelectedItem.ToString() == "ADMIN")
             {
                 if (usernameTb.Text == "admin" && userpasstb.Text == "admin")
                 {
                     ProductForm prod = new ProductForm();
                     prod.Show();
                     this.Hide();
                 }
                 else
                 {
                     MessageBox.Show("If you are the Admin, Enter the correct username and password");
                 }
             }
             else if (logCb.SelectedItem.ToString() == "SELLER")
             {
                 // MessageBox.Show("You are in the Seller Section");
                 Con.Open();
                 SqlDataAdapter sda = new SqlDataAdapter("Select count(8) from SellerTB1 where SellerName='" + usernameTb.Text + "'and SellerPass='******'", Con);
                 DataTable      dt  = new DataTable();
                 sda.Fill(dt);
                 if (dt.Rows[0][0].ToString() == "1")
                 {
                     SellerName = usernameTb.Text;
                     SellingForm sell = new SellingForm();
                     sell.Show();
                     this.Hide();
                     Con.Close();
                 }
                 else
                 {
                     MessageBox.Show("Wrong Username or Password");
                 }
                 Con.Close();
             }
         }
         else
         {
             MessageBox.Show("Select a role");
         }
     }
 }