Ejemplo n.º 1
0
        private void btnModifica_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                DetalleRuta detalle = new DetalleRuta();

                detalle.StartPosition = FormStartPosition.CenterParent;
                detalle.operacion     = (byte)MisConstantes.OPERACION.Modificacion;

                detalle.txtID.Text      = dataGridView1.CurrentRow.Cells["IDRuta"].Value.ToString();
                detalle.txtOrigen.Text  = dataGridView1.CurrentRow.Cells["Ciudad_De_Origen"].Value.ToString();
                detalle.txtDestino.Text = dataGridView1.CurrentRow.Cells["Ciudad_De_Destino"].Value.ToString();
                detalle.txtPrecio.Text  = dataGridView1.CurrentRow.Cells["Precio"].Value.ToString();

                detalle.txtDuracion.Text = dataGridView1.CurrentRow.Cells["Duracion"].Value.ToString();
                detalle.chofer           = dataGridView1.CurrentRow.Cells["Chofer"].Value.ToString();

                detalle.dateTimePicker2.Text = dataGridView1.CurrentRow.Cells["Fecha_De_Viaje"].Value.ToString();
                detalle.boxHora.Text         = dataGridView1.CurrentRow.Cells["Hora_De_Salida"].Value.ToString();


                detalle.chkEstado.Checked = checkBox1.Checked;



                DialogResult rpta = detalle.ShowDialog();

                if (rpta == DialogResult.OK)
                {
                    mostrar_datos();
                }
            }
        }
Ejemplo n.º 2
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            DetalleRuta detalle = new DetalleRuta();

            detalle.StartPosition = FormStartPosition.CenterScreen;
            detalle.operacion     = (byte)MisConstantes.OPERACION.Insercion;

            DialogResult rpta = detalle.ShowDialog();

            if (rpta == DialogResult.OK)
            {
                mostrar_datos();
            }
        }
Ejemplo n.º 3
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            DetalleRuta fmr = new DetalleRuta();

            fmr.Show();
        }