コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(textBox2.Text) && !string.IsNullOrEmpty(textBox3.Text))
     {
         try
         {
             DateTime date   = dateTimePicker1.Value;
             var      trains = _trainNet.GetTrainsBeforeDeparture(textBox3.Text, textBox2.Text, date);
             if (trains == null || !trains.Any())
             {
                 MessageBox.Show("Няма намерени влакове");
             }
             else
             {
                 DisplayData ddf = new DisplayData(trains.ToList());
                 ddf.ShowDialog();
             }
         }
         catch (Exception ex)
         {
             TrainsException.ShowDefault(this, ex);
         }
     }
     else
     {
         MessageBox.Show("Моля въведете необходимите данни!");
     }
 }
コード例 #2
0
ファイル: DisplayData.cs プロジェクト: inferno16/OOP2-Trains
 private void DisplayData_Load(object sender, EventArgs e)
 {
     try
     {
         InitTables();
     }
     catch (Exception ex)
     {
         TrainsException.ShowDefault(this, ex);
     }
 }