コード例 #1
0
ファイル: Form1.cs プロジェクト: GuzeevaEvgenia/Zadacha-3
 private void ShowCommentButton_Click(object sender, EventArgs e)
 {
     try
     {
         Tram tram = (Tram)vehicle[Convert.ToInt32(CommentnumericUpDown2.Value) - 1];
         InfoTextBox.Text += tram.ShowComment() + Environment.NewLine;
     }
     catch { MessageBox.Show("Проверьте корректность данных."); }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: GuzeevaEvgenia/Zadacha-3
 private void AddButton_Click(object sender, EventArgs e)
 {
     try
     {
         IVehicle veh = new Tram(NameTextBox.Text, Convert.ToInt32(YearTextBox.Text), Convert.ToInt32(CostTextBox.Text), Convert.ToInt32(CapTextBox.Text));
         vehicle.Add(veh);
     }
     catch { MessageBox.Show("Проверьте корректность данных."); }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: GuzeevaEvgenia/Zadacha-3
 private void AddCommentButton_Click(object sender, EventArgs e)
 {
     try
     {
         Tram tram = (Tram)vehicle[Convert.ToInt32(CommentnumericUpDown2.Value) - 1];
         tram.AddComment(CommentTextBox.Text);
         vehicle[Convert.ToInt32(CommentnumericUpDown2.Value) - 1] = tram;
     }
     catch { MessageBox.Show("Проверьте корректность данных."); }
 }