예제 #1
0
        private int ObtenerIdRegistroLectura_Ultimo()
        {
            DataTable             dtRL   = new DataTable();
            neg_Consulta_Servidor objSql = new neg_Consulta_Servidor("SELECT MAX(Id) FROM tblRegistroLectura");

            dtRL = objSql.ObtenerConsulta();
            return(int.Parse(dtRL.Rows[0][0].ToString()));
        }
예제 #2
0
        private void CargarPeriodos()
        {
            DataTable             dtP  = new DataTable();
            neg_Consulta_Servidor objP = new neg_Consulta_Servidor("Select * From tblPeriodo");

            dtP = objP.ObtenerConsulta();
            CargarComboBox(ref cmbPeriodo, dtP, "Id");
        }
예제 #3
0
        private float ObtenerPrecioServicioCategoria()
        {
            float                 iPrecio;
            DataTable             dtC    = new DataTable();
            neg_Consulta_Servidor objSql = new neg_Consulta_Servidor("SELECT Precio FROM tblCategoria WHERE Id= (SELECT IdCategoria FROM tblMedidor WHERE Id=" + cmbMedidor.Text + ")");

            dtC     = objSql.ObtenerConsulta();
            iPrecio = float.Parse(dtC.Rows[0][0].ToString());
            return(iPrecio);
        }
예제 #4
0
        private void cmbMedidor_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            DataTable dtMmax = new DataTable();
            neg_RegistroLectura_Servidor objRL = new neg_RegistroLectura_Servidor();
            DataTable dt1 = new DataTable();

            String medidor = cmbMedidor.Text;

            dt1 = objRL.Buscar_Parametrizado("IdMedidor= " + medidor);
            dgvRegistroLectura.DataSource = dt1;
            neg_Consulta_Servidor cstMmax = new neg_Consulta_Servidor("select max(Lectura) from tblRegistroLectura where IdMedidor= " + cmbMedidor.Text);

            dtMmax = cstMmax.ObtenerConsulta();
            string strLecturaAnterior;

            strLecturaAnterior = dtMmax.Rows[0][0].ToString();
            if (strLecturaAnterior.Length < 1)
            {
                strLecturaAnterior = "0";
            }
            lblLecturaAnterior.Text = strLecturaAnterior;
        }