Exemplo n.º 1
0
 private void train_search_Click(object sender, EventArgs e)
 {//вызов поиска поездов
     if ((train_otpr.Text == "") || (train_nazn.Text == "") || (train_nazn.Text == train_otpr.Text))
     {
         label34.Visible = true;
         label34.Text    = "ВВЕДИТЕ ПРАВИЛЬНО СТАНЦИИ";
     }
     else
     {
         listView2.Items.Clear();
         strwork_train ек = new strwork_train();
         label34.Visible = true;
         label34.Text    = ек.zagolovok(train_otpr.Text, train_nazn.Text, train_data.Text);
         if (label34.Text != "Нет информации")
         {
             ек.table(listView2, train_otpr.Text, train_nazn.Text, train_data.Text);
         }
         int a = listw.flag(train_otpr.Text, "train.txt");
         if (a == 0)
         {
             File.AppendAllText("train.txt", "\n" + train_otpr.Text);
             listw.zapoln(listBox3, listBox4, "train.txt");
         }
         int b = listw.flag(train_nazn.Text, "train.txt");
         if (b == 0)
         {
             File.AppendAllText("train.txt", "\n" + train_nazn.Text);
             listw.zapoln(listBox3, listBox4, "train.txt");
         }
     }
 }
Exemplo n.º 2
0
 private void train_search_Click(object sender, EventArgs e)
 {
     //вызов поиска поездов
     if ((train_otpr.Text == "") || (train_nazn.Text == "") || (train_nazn.Text == train_otpr.Text))
     {
         label34.Visible = true;
         label34.Text = "ВВЕДИТЕ ПРАВИЛЬНО СТАНЦИИ";
     }
     else
     {
         listView2.Items.Clear();
         strwork_train ек = new strwork_train();
         label34.Visible = true;
         label34.Text = ек.zagolovok(train_otpr.Text, train_nazn.Text, train_data.Text);
         if (label34.Text != "Нет информации")
         {
             ек.table(listView2, train_otpr.Text, train_nazn.Text, train_data.Text);
         }
         int a = listw.flag(train_otpr.Text, "train.txt");
         if (a == 0)
         {
             File.AppendAllText("train.txt", "\n" + train_otpr.Text);
             listw.zapoln(listBox3, listBox4, "train.txt");
         }
         int b = listw.flag(train_nazn.Text, "train.txt");
         if (b == 0)
         {
             File.AppendAllText("train.txt", "\n" + train_nazn.Text);
             listw.zapoln(listBox3, listBox4, "train.txt");
         }
     }
 }