예제 #1
0
        private void b3_Click(object sender, EventArgs e)
        {
            DriverLogin p = new DriverLogin();

            p.Tag = this;
            p.Show(this);
            Hide();
        }
예제 #2
0
 private void b1_Click(object sender, EventArgs e)
 {
     if (c1.Text == "PASSENGER")
     {
         psglogin p = new psglogin();
         p.Tag = this;
         p.Show(this);
         Hide();
     }
     if (c1.Text == "DRIVER")
     {
         DriverLogin d = new DriverLogin();
         d.Tag = this;
         d.Show(this);
         Hide();
     }
 }
예제 #3
0
        private void b3_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = "Data Source=DESKTOP-4K792AB;" + "Initial Catalog=Taxi project;" + "Integrated Security=True;";
            SqlCommand     com = new SqlCommand();
            SqlDataAdapter da  = new SqlDataAdapter();

            com.Connection  = con;
            com.CommandText = "select * from Driver where Driver.DID=@User and Driver.NCode=@Pass";

            try
            {
                con.Open();
                com.Parameters.AddWithValue("@User", t3.Text);
                com.Parameters.AddWithValue("@Pass", t4.Text);
                da.SelectCommand = com;
                DataTable dt1 = new DataTable();
                da.Fill(dt1);
                t3.Text = dt1.Rows[0]["DID"].ToString();
                MessageBox.Show(t3.Text + "WAS FOUND!!");
                con.Close();
                Dinformation p = new Dinformation(t3.Text);
                p.Tag = this;
                p.Show(this);
                Hide();
            }
            catch (Exception ex)
            {
                MessageBox.Show("National Code Is Already Available!");
                DriverLogin p = new DriverLogin();
                p.Tag = this;
                p.Show(this);
                Hide();
            }
        }