예제 #1
0
        private void comboBox_Patente_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable table = DAOAutomovil.getEstadoYChofer(comboBox_Patente.Text);
            DataRow   row   = table.Rows[0];

            checkBox_Estado.Enabled = false;
            textBox_Chofer.Text     = ((row["PERSONA"]) as string);
            if (Convert.ToInt32(row["COCHE_ESTADO"]) == 1)
            {
                checkBox_Estado.Checked = true;
                checkBox_Estado.Visible = true;
            }
            else
            {
                checkBox_Estado.Visible = false;
            }
        }
예제 #2
0
        private void buttonSeleccionar_Click(object sender, EventArgs e)
        {
            DataTable table = DAOAutomovil.getEstadoYChofer(comboBoxPatente.Text);
            DataRow   row   = table.Rows[0];

            textBox_chofer_dni.Visible = true;
            checkBoxEstado.Visible     = true;
            label5.Visible             = true;
            label7.Visible             = true;
            int    estado = Convert.ToInt32(row["COCHE_ESTADO"]);
            string chofer = row["PERSONA"] as string;
            string dni    = Convert.ToString(row["PERS_DNI"]);

            button_buscar_Chofer.Visible  = true;
            textBox_chofer_nombre.Visible = true;
            textBox_chofer_dni.Visible    = true;
            label8.Visible                 = true;
            textBox_chofer_nombre.Text     = chofer;
            textBox_chofer_nombre.ReadOnly = true;
            textBox_chofer_dni.Text        = dni;
            textBox_chofer_dni.ReadOnly    = true;
            if (estado == 1)
            {
                modificacionDeEstado         = 0;
                checkBoxEstado.Visible       = false;
                label7.Visible               = false;
                textBox_chofer_dni.Enabled   = true;
                checkBoxEstado.Checked       = true;
                labelTurnoHabilitado.Visible = true;
                Turno.Visible              = true;
                label4.Visible             = true;
                TurnoDeshabilitado.Visible = true;
                this.cargarTurnosHabilitados(DAOTurno.getTurnoAsignadoACoche(comboBoxPatente.Text), 1);
                this.cargarTurnosDeshabilitados(DAOTurno.getTurnoNoAsignadoACoche(comboBoxPatente.Text), 0);
            }
            else
            {
                checkBoxEstado.Visible     = true;
                label7.Visible             = true;
                textBox_chofer_dni.Enabled = false;
                modificacionDeEstado       = 1;
            }
            buttonAceptar.Visible = true;
        }