Beispiel #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            DashboardForm dashboard = new DashboardForm();

            dashboard.Show();
            this.Hide();
        }
Beispiel #2
0
 private void bunifuThinButton21_Click(object sender, EventArgs e)
 {
     if (UnameTb.Text == "" || PassTb.Text == "")
     {
         MessageBox.Show("Enter The UserName And Password");
     }
     else
     {
         if (RoleCb.SelectedIndex > -1)
         {
             if (RoleCb.SelectedItem.ToString() == "ADMIN")
             {
                 if (UnameTb.Text == "Admin" && PassTb.Text == "Admin")
                 {
                     DashboardForm dashboard = new DashboardForm();
                     dashboard.Show();
                     this.Hide();
                 }
                 else
                 {
                     MessageBox.Show("If You are the Admin, Enter The Correct Id and Password");
                 }
             }
             else
             {
                 //MessageBox.Show("Your 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("Wrong UserName or Password");
                 }
                 Con.Close();
             }
         }
         else
         {
             MessageBox.Show("Select A Role");
         }
     }
 }