コード例 #1
0
 private void dgvProducciones_DoubleClick(object sender, EventArgs e)
 {
     if (dgvProducciones.CurrentRow.Index != -1)
     {
         EN.Produccion other     = produccionController.ObtenerProduccionPorId(Convert.ToInt32(dgvProducciones.CurrentRow.Cells["id"].Value));
         EN.Taxis      txs       = taxisController.GetTaxi(other.placa);
         BR.Conductor  conductor = conductoresController.MostarConductorxNombre(other.conductor);
         EN.itemList   item      = new EN.itemList(conductor.id, conductor.nombre.ToUpper() + " " + conductor.apellido.ToUpper());
         int           index     = cmbConductor.FindString(item.descipcion);
         cmbConductor.SelectedIndex = index;
         //Pintar los datos
         cmbTx.Text      = txs.placa.Trim().ToUpper() + " " + txs.marca;
         dtpInicio.Value = other.inicio;
         dtpFinal.Value  = other.final;
         double pdia = other.producido / other.dias;
         txtLiquidaciondia.Text     = pdia.ToString();
         txtTotal.Text              = other.producido.ToString();
         txtTotal.ReadOnly          = true;
         txtDiasTrabajados.Text     = other.dias.ToString();
         txtDiasTrabajados.ReadOnly = true;
     }
     else
     {
         MessageBox.Show("Seleccione un registro");
     }
 }
コード例 #2
0
        private void dgvLic_DoubleClick(object sender, EventArgs e)
        {
            txtNumero.Enabled = false;
            txtNumero.Text    = Convert.ToString(dgvLic.CurrentRow.Cells["Numero_pase"].Value);
            var other = coductoresController.MostarConductorxNombre(Convert.ToString(dgvLic.CurrentRow.Cells["Conductor"].Value));

            cmbConductor.Items.Insert(0, other.cedula.Trim() + " " + other.nombre.Trim() + " " + other.apellido.Trim());
            cmbConductor.SelectedIndex = 0;
            cmbTransito.Items.Insert(0, dgvLic.CurrentRow.Cells["id_secretaria"].Value);
            cmbTransito.SelectedIndex = 0;
            cmbCategoria.Items.Insert(0, dgvLic.CurrentRow.Cells["categoria"].Value);
            cmbCategoria.SelectedIndex = 0;
        }
コード例 #3
0
        public bool ActualizarCT(EN.ConductoresXtaxis other)
        {
            bool resultado = false;

            try
            {
                var      update = db.ConductoresXtaxis.Where(x => x.id == other.id).FirstOrDefault();
                string   nombre = other.conductor;
                string[] n      = nombre.Split(' ');
                update.idConductor = conductorController.MostarConductorxNombre(n[0]).id;
                update.placaTaxi   = other.placaTaxi;
                db.SaveChanges();
                resultado = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }