Beispiel #1
0
 private void addtour_Click(object sender, EventArgs e)
 {
     comm             = con.CreateCommand();
     comm.CommandText = "INSERT INTO project.buy_tour (`t_id`, `u_id`) " + "VALUES  " + "(@tid,@uid)";
     comm.Parameters.AddWithValue("@tid", TidInfo.Name);
     comm.Parameters.AddWithValue("@uid", UserInfo.Name);
     try
     {
         int rowsAffected = comm.ExecuteNonQuery();
         MessageBox.Show("Tour Added!");
         Alltour newform = (Alltour)Application.OpenForms["Alltour"];
         newform.Close();
         Acc oldform = (Acc)Application.OpenForms["Acc"];
         oldform.Close();
         this.Close();
         Acc fm = new Acc(UserInfo.Name);
         fm.Show();
         con.Close();
     }
     catch
     {
         MessageBox.Show("Tour already in your plan!");
     }
 }
Beispiel #2
0
        private void edit_Click(object sender, EventArgs e)
        {
            Alltour f2 = new Alltour();

            f2.Show();
        }