private void listBox_Help_Click(object sender, EventArgs e) { if (this.listBox_Help.SelectedItems.Count == 1) { CargoUnit selectedCargoUnit = CargoUnit.cargoUnitArray_[this.listBox_Help.SelectedIndex]; this.label_help2.Text = "Название компании: " + selectedCargoUnit.TransportCompanyName + "\nЗапланированный объём, тыс. на км: " + selectedCargoUnit.PlannedCargoSize.ToString() + "\nCтоимость перевозки, 1 тыс.на км: " + selectedCargoUnit.OneCargoPrice.ToString(); } }
private void help_button_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in dataGrid_transportCargo.Rows) { CargoUnit cargo_unit = new CargoUnit(Convert.ToString(row.Cells[0].Value), Convert.ToInt64(row.Cells[1].Value), Convert.ToInt64(row.Cells[2].Value)); cargo_unit.CargoUnit_Add(); } Help_Form help_form2 = new Help_Form(); this.Hide(); help_form2.ShowDialog(); }