AerolineaFrba.Registro_Llegada_Destino.Form2.Form2 C# (CSharp) Метод

Form2() публичный Метод

public Form2 ( DataGridViewRow registro, int viajeCod ) : System
registro DataGridViewRow
viajeCod int
Результат System
        public Form2(DataGridViewRow registro, int viajeCod)
        {
            InitializeComponent();
            dateTimePicker1.Format = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "dd/MM/yyyy - HH:mm:ss";
            /*dateTimePicker1.MinDate = fechaSalida;
            dateTimePicker1.MaxDate = fechaSalida.AddDays(1);*/
            dateTimePicker1.Value = Program.fechaHoy();

            viaje_cod = viajeCod;

            SqlDataReader reader;
            SqlCommand consultaServicios = new SqlCommand();
            consultaServicios.CommandType = CommandType.Text;
            consultaServicios.CommandText = "SELECT s.SERV_DESC FROM [ABSTRACCIONX4].[AERONAVES] a JOIN [ABSTRACCIONX4].[SERVICIOS] s ON a.SERV_COD = s.SERV_COD WHERE a.AERO_MATRI = '" + registro.Cells["Matricula"].Value.ToString() + "'";
            consultaServicios.Connection = Program.conexion();

            reader = consultaServicios.ExecuteReader();
            reader.Read();

            txtServicio.Text = reader.GetString(0);
            txtMatricula.Text = registro.Cells["Matricula"].Value.ToString();
            txtModelo.Text = registro.Cells["Modelo"].Value.ToString();
            txtFabricante.Text = registro.Cells["Fabricante"].Value.ToString();
            txtCantButacas.Text = registro.Cells["Cant. Butacas"].Value.ToString();
            txtCantKgs.Text = registro.Cells["Cant. Kgs"].Value.ToString();
        }