Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Selling sell = new Selling();

            sell.Show();
            this.Hide();
        }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (loguser.Text == "" || logpass.Text == "")
     {
         MessageBox.Show("PLEASE INSERT USERNAME AND PASSWWORD!");
     }
     if (logrole.Text == "ADMIN")
     {
         if (loguser.Text == "admin" && logpass.Text == "admin")
         {
             Product prod = new Product();
             prod.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Wrong Username and or Password");
         }
     }
     else if (logrole.Text == "SELLER")
     {
         try
         {
             Con.Open();
             string         query = "select count(8) from seller where SellerName = '" + loguser.Text + "' and SellerPass = '******'";
             SqlDataAdapter sda   = new SqlDataAdapter(query, Con);
             DataTable      dt    = new DataTable();
             sda.Fill(dt);
             if (dt.Rows[0][0].ToString() == "1")
             {
                 Selling seli = new Selling(loguser.Text);
                 seli.Show();
                 this.Hide();
             }
             else
             {
                 MessageBox.Show("Wrong Username and or Password");
             }
             Con.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         MessageBox.Show("PICK A ROLE FIRST!");
     }
 }