private void mnuGuardar_Click(object sender, EventArgs e) { neg_RegistroLectura_Movil objRL_M = new neg_RegistroLectura_Movil(); neg_RegistroLectura_Servidor objRL_S = new neg_RegistroLectura_Servidor(); int id = int.Parse(lblId.Text); DateTime fecha = Convert.ToDateTime(txtFecha.Text); //DateTime.Parse(dtpFecha.Text); //DateTime fecha = DateTime.Parse(txtFecha.Text); //DateTime.Parse(dtpFecha.Text); int lecturaActual = int.Parse(txtLecturaActual.Text); bool enviado = false; //bool.Parse(txtEnviado.Text); int idLecturador = int.Parse(cmbLecturador.Text); int periodo = int.Parse(cmbPeriodo.Text); int idMedidor = int.Parse(cmbMedidor.Text); //objRL_M.Insertar(id, fecha, lecturaActual, enviado, idLecturador, periodo, idMedidor); objRL_S.Insertar(id, fecha, lecturaActual, enviado, idLecturador, periodo, idMedidor); }
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; }