Esempio n. 1
0
 private void btnEditar_Click(object sender, EventArgs e)
 {
     _nuevo = false;
     if (btnEditar.Text == "Cancelar")
     {
         LimpiarControl(gbDatos);
         ActivarControlDatos(gbDatos, false);
         ActivarButton(true);
         dgvDatos.Enabled = true;
         btnEditar.Text   = "Editar";
     }
     else
     {
         if (dgvDatos.RowCount > 0)
         {
             c = blCliente.ClienteTraerPorId((int)dgvDatos[0, dgvDatos.CurrentRow.Index].Value);
             txtCodigo.Text        = c.IdConductor.ToString();
             txtNombre.Text        = c.CliNombres;
             txtApellido.Text      = c.CliApellidos;
             comboBox.SelectedItem = c.CliLicenciaTransito;
             txtCorreo.Text        = c.CliCorreo;
             txtCelular.Text       = c.CliCelular;
             txtDireccion.Text     = c.CliDireccion;
             UsuarioLogeado.Nombre = c.CliUsuario;
             // DateTime.Now = c.CliFechaReg;
             UsuarioLogeado.Nombre = c.CliUsuarioEdita;
             //DateTime.Now = c.CliFechaEdita;
             ActivarControlDatos(gbDatos, true);
             ActivarButton(false);
             btnGrabar.Enabled = true;
             dgvDatos.Enabled  = false;
             btnEditar.Text    = "Cancelar";
         }
     }
 }
Esempio n. 2
0
        private void cbProgramacion_SelectionChangeCommitted(object sender, EventArgs e)
        {
            ma = new Mantenimiento();
            ma = blMan.porId(Convert.ToInt32(cbProgramacion.SelectedValue));

            cl = blCliente.ClienteTraerPorId(ma.IdCliente);
            txtDocumento.Text = cl.CliCelular;
            txtNombre.Text    = cl.CliNombres;
            txtApellido.Text  = cl.CliApellidos;
            txtEmpresa.Text   = "";
            txtEstado.Text    = "";
            txtCategoria.Text = "";

            ve             = blVehi.VehiculoTraerPorId(ma.Idvehiculo);
            txtPlaca.Text  = ve.Placa;
            txtLinea.Text  = ve.Linea;
            txtClase.Text  = ve.Clase;
            txtCombus.Text = ve.Combustible;
            txtMarca.Text  = ve.Marca;
            txtModelo.Text = ve.Modelo;

            manDet = blManDet.listarPorId(Convert.ToInt32(cbProgramacion.SelectedValue));
            comboGasesGasolina.SelectedItem = manDet.ManDetEmiGasGas;
            comboLucesP.SelectedItem        = manDet.ManDetLucPrin;
            comboPFrenado.SelectedItem      = manDet.ManDetPruFre;
            comboAlineacion.SelectedItem    = manDet.ManDetAli;
            comboGasesDiesel.SelectedItem   = manDet.ManDetEmiGasDis;
            comboAdherencia.SelectedItem    = manDet.ManDetAdh;
            txtGrupoFrenos.Text             = manDet.ManDetGruFre;
            txtGrupoSuspension.Text         = manDet.ManDetGruSus;
            txtGrupoLuces.Text       = manDet.ManDetGruLuc;
            txtRinesyLlantas.Text    = manDet.ManDetRinLLa;
            txtGrupoDir.Text         = manDet.ManDetGruDir;
            txtGrupoVidrios.Text     = manDet.ManDetGruVid;
            txtGrupoTransmision.Text = manDet.ManDetGruTran;
            txtRevisionInterior.Text = manDet.ManDetRevInt;
            txtGrupoMotor.Text       = manDet.ManDetGruMot;
            txtRevisionEnterior.Text = manDet.ManDetRevExt;
            txtapto.Text             = manDet.ManDetEstado;
        }