Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // todo:  call db and check last run, this will prevent spoofing of the url request

            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            try
            {
                using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_insert"))
                {
                    sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                    sqlCommand.Parameters.Add(new SqlParameter("@serverUTCDate", "test date"));
                    sqlCommand.Parameters.Add(new SqlParameter("@jsonData", "{testing db from console app}"));

                    da.executeSqlCommandStoredProcedure(sqlCommand);

                    da = null;

                }
            }
            catch (Exception ex)
            {
                //ErrorLoggingController el = new ErrorLoggingController();
                //el.LogToDatabase(PCName, "Failed to reset ContentDownload_Timestamp.", string.Format("GateName {0} - {1} {2}", PCName, ex.Message, ex.StackTrace));
                //el = null;
            }
        }
        public void insert(string jsonData)
        {
            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_insert"))
            {
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(new SqlParameter("@jsonData", jsonData));
                da.executeSqlCommandStoredProcedure(sqlCommand);

                da = null;
            }
        }
        public string getLastEntry()
        {
            ABProviderDataSqlAskAby da = new ABProviderDataSqlAskAby();

            using (SqlCommand sqlCommand = new SqlCommand("budhill_weather_getLastEntry"))
            {
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
                da.executeSqlCommandStoredProcedure(sqlCommand);

                da = null;
            }

            return string.Empty;
        }