Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            SellingForm selling = new SellingForm();

            selling.Show();
            this.Hide();
        }
Example #2
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (username.Text == "" || password.Text == "")
     {
         MessageBox.Show("Enter The Username and Password");
     }
     else
     {
         if (RoleCat.SelectedIndex > -1)
         {
             if (RoleCat.SelectedItem.ToString() == "ADMIN")
             {
                 if (username.Text == "Admin" && password.Text == "Admin")
                 {
                     ProdukForm produk = new ProdukForm();
                     produk.Show();
                     this.Hide();
                 }
                 else
                 {
                     MessageBox.Show("If You are The Admin Enter The Correct Username and Password");
                 }
             }
             else
             {
                 //MessageBox.Show("You are in Seller Section");
                 connect.Open();
                 string         query   = "select count(2) from Seller where NamaSeller='" + username.Text + "' and PassSeller='" + password.Text + "' ";
                 SqlDataAdapter sda     = new SqlDataAdapter(query, connect);
                 DataTable      dataset = new DataTable();
                 sda.Fill(dataset);
                 if (dataset.Rows[0][0].ToString() == "1")
                 {
                     NamaSeller = username.Text;
                     SellingForm sell = new SellingForm();
                     sell.Show();
                     this.Hide();
                     connect.Close();
                 }
                 else
                 {
                     MessageBox.Show("Wrong Username or Password");
                 }
                 connect.Close();
             }
         }
         else
         {
             MessageBox.Show("Select a Role");
         }
     }
 }
Example #3
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (UnameTb.Text == "" || PassTb.Text == "")
     {
         MessageBox.Show("Enter The Username and Password");
     }
     else
     {
         if (RolerCb.SelectedIndex > -1)
         {
             if (RolerCb.SelectedItem.ToString() == "ADMIN")
             {
                 if (UnameTb.Text == "Admin" && PassTb.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
             {
                 //MessageBox.Show("You are in the Seller Section");
                 Con.Open();
                 SqlDataAdapter sda = new SqlDataAdapter("Select count(8) from SellerTbl where SellerName='" + UnameTb.Text + "' and SellerPass='******'", Con);
                 DataTable      dt  = new DataTable();
                 sda.Fill(dt);
                 if (dt.Rows[0][0].ToString() == "1")
                 {
                     SellerName = UnameTb.Text;
                     SellingForm sell = new SellingForm();
                     sell.Show();
                     this.Hide();
                     Con.Close();
                 }
                 else
                 {
                     MessageBox.Show("Invalid Username and/or Password");
                 }
             }
         }
         else
         {
             MessageBox.Show("Select a Role");
         }
     }
 }