示例#1
0
        public static DateTime ProximaFechaCalibracion(int CodInstrumento, string Estado, DateTime Fecha)
        {
            DateTime FechaP = new DateTime(1900, 01, 01);

            DataTable DT = NInstrumento.Buscar(CodInstrumento);

            string InstruFrecu = Estado == "Nuevo" ? Convert.ToString(DT.Rows[0][3]) : Convert.ToString(DT.Rows[0][4]);

            DT = NFrecuencia.Buscar(InstruFrecu);

            string sFrecu = Convert.ToString(DT.Rows[0][2]);
            int    nFrecu = Convert.ToInt32(DT.Rows[0][3]);

            if (sFrecu == "D")
            {
                FechaP = Fecha.AddDays(nFrecu);
            }
            else if (sFrecu == "M")
            {
                FechaP = Fecha.AddMonths(nFrecu);
            }

            FechaP = (int)FechaP.DayOfWeek == 0 ? FechaP.AddDays(1) :
                     (int)FechaP.DayOfWeek == 7 ? FechaP.AddDays(2) :
                     FechaP;

            return(FechaP);
        }
示例#2
0
        private void CargaEncabezado()
        {
            DataTable DTInstru = new DataTable();

            DTInstru           = NInstrumento.Buscar(IDInstrumento);
            txtCodInstru.Text  = Convert.ToString(DTInstru.Rows[0][1]);
            txtDescInstru.Text = Convert.ToString(DTInstru.Rows[0][2]);

            txtCodInstru.Enabled  = false;
            txtDescInstru.Enabled = false;

            txtCodInstru.BackColor  = System.Drawing.SystemColors.ControlLightLight;
            txtDescInstru.BackColor = System.Drawing.SystemColors.ControlLightLight;
        }
示例#3
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);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ///  FUNCIONES Y PROCEDIMIENTOS
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void CargaEncabezado()
        {
            DataTable DTInstru = new DataTable();

            DTInstru           = NInstrumento.Buscar(Convert.ToInt32(IDInstrumento.Cells[0].Value));
            txtCodInstru.Text  = Convert.ToString(DTInstru.Rows[0][1]);
            txtDescInstru.Text = Convert.ToString(DTInstru.Rows[0][2]);
            FrecNuevo          = Convert.ToString(DTInstru.Rows[0][3]);
            FrecUsado          = Convert.ToString(DTInstru.Rows[0][4]);

            txtCodInstru.Enabled  = false;
            txtDescInstru.Enabled = false;

            txtCodInstru.BackColor  = System.Drawing.SystemColors.ControlLightLight;
            txtDescInstru.BackColor = System.Drawing.SystemColors.ControlLightLight;
        }
示例#5
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;
        }