Exemplo n.º 1
0
 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("Проверьте корректность данных."); }
 }
Exemplo n.º 2
0
 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("Проверьте корректность данных."); }
 }
Exemplo n.º 3
0
 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("Проверьте корректность данных."); }
 }