private Ami_Medidores_Instalados[] getData(string q) { model.cnx cnx = new cnx(); DataTable dataTable = new DataTable(); Ami_Medidores_Instalados t = null; Ami_Medidores_Instalados[] tarr = null; dataTable = cnx.hacerSelect(q); int cantidad = dataTable.Rows.Count; if (dataTable != null && cantidad > 0) { tarr = new Ami_Medidores_Instalados[cantidad]; for (int i = 0; i < cantidad; i++) { t = new Ami_Medidores_Instalados(); t.ID = int.Parse(dataTable.Rows[i]["ID"].ToString()); t.COD_MEDIDOR = dataTable.Rows[i]["COD_MEDIDOR"].ToString(); t.COD_INTERNO = dataTable.Rows[i]["COD_INTERNO"].ToString(); t.RUTA = dataTable.Rows[i]["RUTA"].ToString(); t.ESN = dataTable.Rows[i]["ESN"].ToString(); tarr[i] = t; } } return(tarr); }
public Ami_Period[] getData(string q) { model.cnx cnx = new cnx(); DataTable dataTable = new DataTable(); Ami_Period p = null; Ami_Period[] parr = null; dataTable = cnx.hacerSelect(q); int cantidad = dataTable.Rows.Count; if (dataTable != null && cantidad > 0) { parr = new Ami_Period[cantidad]; for (int i = 0; i < cantidad; i++) { p = new Ami_Period(); p.id = int.Parse(dataTable.Rows[i]["id"].ToString()); p.status = int.Parse(dataTable.Rows[i]["status"].ToString()); p.emissionDate = Convert.ToDateTime(dataTable.Rows[i]["emissionDate"].ToString()); p.endDate = Convert.ToDateTime(dataTable.Rows[i]["endDate"].ToString()); p.monthDate = int.Parse(dataTable.Rows[i]["monthDate"].ToString()); p.yearDate = int.Parse(dataTable.Rows[i]["yearDate"].ToString()); p.idPeriodRead = dataTable.Rows[i]["idPeriodRead"].ToString(); parr[i] = p; } } return(parr); }
private Ami_Token[] getData(string q) { model.cnx cnx = new cnx(); DataTable dataTable = new DataTable(); Ami_Token t = null; Ami_Token[] tarr = null; dataTable = cnx.hacerSelect(q); int cantidad = dataTable.Rows.Count; if (dataTable != null && cantidad > 0) { tarr = new Ami_Token[cantidad]; for (int i = 0; i < cantidad; i++) { t = new Ami_Token(); t.id = int.Parse(dataTable.Rows[i]["id"].ToString()); t.meter = dataTable.Rows[i]["meter"].ToString(); t.period = int.Parse(dataTable.Rows[i]["period"].ToString()); t.status = int.Parse(dataTable.Rows[i]["status"].ToString()); t.token = dataTable.Rows[i]["token"].ToString(); t.tokenType = dataTable.Rows[i]["tokenType"].ToString(); tarr[i] = t; } } return(tarr); }