Exemplo n.º 1
0
        private void CargarDetalles()
        {
            dataItemCalibracion.AutoGenerateColumns = false;
            if (AccionEnviada == "Nuevo")
            {
                dataItemCalibracion.DataSource = DataItemsCalibracion;
                dataItemCalibracion.ClearSelection();
            }
            else if (AccionEnviada == "Actualizar")
            {
                DataTable DTDeta = NCalibracion.BuscarDetalles(Convert.ToInt32(DataCalibracion.Cells[3].Value)
                                                               , Convert.ToInt32(DataIdentidad.Cells[1].Value)
                                                               , Convert.ToInt32(DataIdentidad.Cells[0].Value));
                dataItemCalibracion.Columns[0].DataPropertyName = "Selecc";
                dataItemCalibracion.Columns[1].DataPropertyName = "id_Item";
                dataItemCalibracion.Columns[4].DataPropertyName = "MediObtenida";
                dataItemCalibracion.Columns[6].DataPropertyName = "DiferObtenida";
                dataItemCalibracion.Columns[7].DataPropertyName = "Estado";

                dataItemCalibracion.DataSource = DTDeta;
            }

            for (int i = 0; i <= dataItemCalibracion.ColumnCount - 1; i++)
            {
                dataItemCalibracion.Columns[i].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
        }
 private void CargaDatosNuevo()
 {
     txtId.BackColor      = System.Drawing.SystemColors.ControlLightLight;
     txtId.Text           = Convert.ToString(CargaProximaIdentidad());
     txtCalibra.Text      = Convert.ToString(NCalibracion.ProximoCodigoIndividual(Convert.ToInt32(IDInstrumento.Cells[0].Value), CargaProximaIdentidad()));
     txtCalibra.BackColor = System.Drawing.SystemColors.ControlLightLight;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Carga el DataGrid dataIndividualizacion
 /// </summary>
 private void ListarCalibracion()
 {
     if (dataIndividualizacion.SelectedRows.Count > 0)
     {
         int indice = dataIndividualizacion.SelectedRows[0].Index;
         txtResponsable.Text        = Convert.ToString(dataIndividualizacion[4, indice].Value) + " - " + Convert.ToString(dataIndividualizacion[5, indice].Value);
         dataCalibracion.DataSource = NCalibracion.Listar(Convert.ToInt32(dataIndividualizacion[0, indice].Value), Convert.ToInt32(dataIndividualizacion[1, indice].Value));
     }
     else
     {
         txtResponsable.Text = "-";
         //dataCalibracion.DataSource = null;
         DataTable DT = (DataTable)dataCalibracion.DataSource;
         if (DT != null)
         {
             DT.Clear();
         }
         // if (dataCalibracion.Rows.Count > 0) dataCalibracion.Rows.Clear();
     }
 }
Exemplo n.º 4
0
        private void CargarEncabezado()
        {
            DataTable DTInstru = new DataTable();

            DTInstru           = NInstrumento.Buscar(Convert.ToInt32(DataIdentidad.Cells[0].Value));
            txtCodInstru.Text  = Convert.ToString(DTInstru.Rows[0][1]);
            txtDescInstru.Text = Convert.ToString(DTInstru.Rows[0][2]);

            txtId.Text          = Convert.ToString(DataIdentidad.Cells[1].Value);
            txtEstado.Text      = Convert.ToString(DataIdentidad.Cells[3].Value);
            txtCodEmp.Text      = Convert.ToString(DataIdentidad.Cells[4].Value);
            txtNomEmp.Text      = Convert.ToString(DataIdentidad.Cells[5].Value);
            txtCertificado.Text = Convert.ToString(DataIdentidad.Cells[9].Value);
            txtMarca.Text       = Convert.ToString(DataIdentidad.Cells[10].Value);

            if (AccionEnviada == "Nuevo")
            {
                txtCalibra.Text   = Convert.ToString(NCalibracion.ProximoCodigoIndividual(Convert.ToInt32(DataIdentidad.Cells[0].Value), Convert.ToInt32(DataIdentidad.Cells[1].Value)));
                dtpFecCalib.Text  = Convert.ToString(DataIdentidad.Cells[8].Value);
                dtpProxCalib.Text = Convert.ToString(Funciones.ProximaFechaCalibracion(Convert.ToInt32(DataIdentidad.Cells[0].Value), txtEstado.Text.Trim(), dtpFecCalib.Value));
            }
            else if (AccionEnviada == "Actualizar")
            {
                txtCalibra.Text   = Convert.ToString(DataCalibracion.Cells[3].Value);
                dtpFecCalib.Text  = Convert.ToString(DataCalibracion.Cells[4].Value);
                dtpProxCalib.Text = Convert.ToString(Funciones.ProximaFechaCalibracion(Convert.ToInt32(DataIdentidad.Cells[0].Value), txtEstado.Text.Trim(), dtpFecCalib.Value));
            }


            txtCodInstru.BackColor   = System.Drawing.SystemColors.ControlLightLight;
            txtDescInstru.BackColor  = System.Drawing.SystemColors.ControlLightLight;
            txtId.BackColor          = System.Drawing.SystemColors.ControlLightLight;
            txtEstado.BackColor      = System.Drawing.SystemColors.ControlLightLight;
            txtCodEmp.BackColor      = System.Drawing.SystemColors.ControlLightLight;
            txtNomEmp.BackColor      = System.Drawing.SystemColors.ControlLightLight;
            txtCertificado.BackColor = System.Drawing.SystemColors.ControlLightLight;
            txtMarca.BackColor       = System.Drawing.SystemColors.ControlLightLight;
            txtCalibra.BackColor     = System.Drawing.SystemColors.ControlLightLight;
        }