Beispiel #1
0
 public void fil_ostanivki(string str_it)
 {
     ostanovki.Add(Glades.Poiskostanovoki(str_it));
 }
Beispiel #2
0
        private void Receive_data1_Click(object sender, EventArgs e)
        {
            if (curitem_inteface == "0")
            {
                string str = c_b.Text; int proverka_na_povtor = 0;
                if (K != 0)
                {
                    proverka_na_povtor = Glades.Proverka_poezdov(str, glades.current_trains);
                }

                if ((str == "") && (K == 0))
                {
                    for (int i = 0; i < Glades.trains.Count; i++)
                    {
                        K++;
                        Vivod_poezdov_marshrutov(i);
                    }
                }
                else
                {
                    if (proverka_na_povtor == 0)
                    {
                        for (int i = 0; i < Glades.trains.Count; i++)
                        {
                            if (str == Glades.trains[i].Nomer)
                            {
                                K++;
                                Vivod_poezdov_marshrutov(i);
                            }
                        }
                    }
                }
            }

            if (curitem_inteface == "1")
            {
                string str1 = textBox4.Text, str2 = textBox3.Text; int proverka_na_povtor = 0;
                string str_ob = str1 + str2;
                if (K != 0)
                {
                    proverka_na_povtor = Glades.Proverka_poezdov(str_ob, glades.current_trains);
                }

                if ((str_ob == "") && (K == 0))
                {
                    for (int i = 0; i < Glades.trains.Count; i++)
                    {
                        K++;
                        Vivod_poezdov_marshrutov(i);
                    }
                }
                else
                {
                    if (proverka_na_povtor == 0)
                    {
                        for (int i = 0; i < Glades.trains.Count; i++)
                        {
                            if ((Glades.marshruti[i].Start + Glades.marshruti[i].End).Contains(str_ob))
                            {
                                K++;
                                Vivod_poezdov_marshrutov(i);
                            }
                        }
                    }
                }
            }

            if (curitem_inteface == "2")
            {
                string str1 = textBox1.Text; string str2 = textBox6.Text; vivod_pas.Rows.Add(); vivod_bil.Rows.Add();
                string str_ob = str1 + str2;
                if (str_ob == "")
                {
                    for (int i = 0; i < Glades.trains.Count; i++)
                    {
                        for (int j = 0; j < Glades.trains[i].passanger.Count; j++)
                        {
                            Glades.trains[i].passanger[j].Vivod(ref vivod_pas, ref count);
                            count++;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < Glades.trains.Count; i++)
                    {
                        for (int j = 0; j < Glades.trains[i].passanger.Count; j++)
                        {
                            if ((Glades.trains[i].passanger[j].Surname + Glades.trains[i].passanger[j].Name).Contains(str_ob))
                            {
                                Glades.trains[i].passanger[j].Vivod(ref vivod_pas, ref count);
                                count++;
                            }
                        }
                    }
                }
            }
        }