public static int InsertData1000(ObsParams params1, float[] GHISum1000, float[] GTISum1000) { int ret = MysqlDAO.Insert2Db1000(params1, GHISum1000, GTISum1000); return(ret); /* string sql = @" insert into obsdata(StationName,StationNO,ObsTime,GHI,GTI,PanleTemp,Temperature,Humitity,WindSpeed,WindDir,GHISum,GTISum) * values(@StationName,@StationNO,@ObsTime,@GHI,@GTI,@PanleTemp,@Temperature,@Humitity,@WindSpeed,@WindDir,@GHISum,@GTISum) * * "; * * try * { * List<OleDbParameter> paramList = new List<OleDbParameter>(); * paramList.Add(new OleDbParameter("@StationName", params1.StationName)); * paramList.Add(new OleDbParameter("@StationNO", params1.StationNO)); * paramList.Add(new OleDbParameter("@ObsTime", params1.ObsTime)); * paramList.Add(new OleDbParameter("@GHI", params1.GHI)); * paramList.Add(new OleDbParameter("@GTI", params1.GTI)); * paramList.Add(new OleDbParameter("@PanleTemp", params1.PanleTemp)); * paramList.Add(new OleDbParameter("@Temperature", params1.Temperature)); * paramList.Add(new OleDbParameter("@Humitity", params1.Humitity)); * paramList.Add(new OleDbParameter("@WindSpeed", params1.WindSpeed)); * paramList.Add(new OleDbParameter("@WindDir", params1.WindDir)); * paramList.Add(new OleDbParameter("@GHISum", params1.GHISum)); * paramList.Add(new OleDbParameter("@GTISum", params1.GTISum)); * * return AccessHelper.ExecuteNonQuery(conn, sql, paramList.ToArray()); * } * catch (System.Exception ex) * { * return 0; * }*/ }
public static DataTable SelectData(string stationName, DateTime starttime, DateTime endtime1) { DataTable dt = MysqlDAO.SelectData(stationName, starttime, endtime1); return(dt); // string sql = @" SELECT ObsTime,StationNO,GHI,GTI,PanleTemp,Temperature,Humitity,WindSpeed,WindDir,GHISum,GTISum // FROM obsdata // where StationName =@StationName and obstime > @starttime and obstime<@endtime";//; // // DataTable dt = null; // try // {//equipno=@equipnoand // List<OleDbParameter> paramList = new List<OleDbParameter>(); // paramList.Add(new OleDbParameter("@StationName", stationName)); // paramList.Add(new OleDbParameter("@starttime", starttime)); // paramList.Add(new OleDbParameter("@endtime", endtime1)); // DataSet ds = AccessHelper.ExecuteDataSet(conn, sql, paramList.ToArray());// // dt = ds.Tables[0]; // } // catch (System.Exception ex) // { // } // return dt; }
public static int Exist(string stationNO, DateTime starttime) { int ret = MysqlDAO.Exist(stationNO, starttime); return(ret); // string sql = @" SELECT ObsTime // FROM obsdata // where StationName =@StationName and obstime = @starttime";//; // // DataTable dt = null; // try // { //equipno=@equipnoand // List<OleDbParameter> paramList = new List<OleDbParameter>(); // paramList.Add(new OleDbParameter("@StationName", stationName)); // paramList.Add(new OleDbParameter("@starttime", starttime)); // DataSet ds = AccessHelper.ExecuteDataSet(conn, sql, paramList.ToArray());// // dt = ds.Tables[0]; // if (dt != null && dt.Rows.Count > 0) // { // return 1; // } // else return 0; // } // catch (System.Exception ex) // { // return -1; // } }