public bool setData(string q) { bool r = false; cnx cnx = new cnx(); if (cnx.abrir()) { r = cnx.hacerHit(q); } return(r); }
public bool insert() { bool r = false; string q = "INSERT INTO AMI.dbo.Ami_Reads " + "(fecha_lectura, whd, cod_medidor, whr, whnet, token_result, esn, serialnumber, readjson, token_request, period) " + "VALUES('" + fecha_lectura.ToString("yyyy-MM-dd HH:mm:ss") + "'," + whd + ",'" + cod_medidor + "'," + whr + "," + whnet + ",'" + token_result + "','" + esn + "','" + serialnumber + "','" + readjson + "','" + token_request + "'," + period + "); "; cnx cnx = new cnx(); if (cnx.abrir()) { r = cnx.hacerHit(q); } return(r); }
public bool insert() { bool r = false; string q = "INSERT INTO AMI.dbo.Ami_Control " + "(status, token, meter, jsonData,executedDate) " + "VALUES( '" + status + "', '" + token + "', '" + meter + "', '" + jsonData + "', GETDATE()); "; cnx cnx = new cnx(); if (cnx.abrir()) { r = cnx.hacerHit(q); } return(r); }