/// <summary>
 /// 获取固定网址数据
 /// </summary>
 /// <returns></returns>
 public DataTable GetFixedWebsite()
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_website order by WebOrder";
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, null);
     }
     catch
     {
     }
     return data;
 }
Example #2
0
 public int ClearConfigWebsite()
 {
     int result = 0;
     try
     {
         string sqlString = @"delete from t_website_config";
         SqlAction action = new SqlAction();
         result = action.IntQuery(sqlString, null);
     }
     catch
     {
     }
     return result;
 }
 public string GetDefaultSearch()
 {
     string result = string.Empty;
     try
     {
         string sqlString = @"select Value  from t_config where Name = 'DefaultSearch'";
         SqlAction action = new SqlAction();
         result = action.StringQuery(sqlString, null);
     }
     catch
     {
     }
     return result;
 }
 /// <summary>
 /// 获取当前“定时表”数据
 /// </summary>
 /// <returns></returns>
 public DataTable GetDingshi()
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_dingshi";
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, null);
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
     return data;
 }
 public int ClearWebsiteData()
 {
     int result = 0;
     try
     {
         string sql = "delete from t_website";
         SqlAction action = new SqlAction();
         result = action.IntQuery(sql, null);
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
     return result;
 }
Example #6
0
        public int AddConfigWebsite(string webOrder, string name, string url)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_website_config(WebOrder,Name,URL)values(@WebOrder,@Name,@URL)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@WebOrder",webOrder),
                                         new SQLiteParameter("@Name",name),
                                         new SQLiteParameter("@URL",url)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #7
0
        public int AddReminder(Reminder reminder)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_tixing(Id,Time,Info)values(@Id,@Time,@Info)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Id",reminder.ReminderId),
                                         new SQLiteParameter("@Time",reminder.ReminderTime.ToString("yyyy-MM-dd HH:mm:ss")),
                                         new SQLiteParameter("@Info",reminder.ReminderInfo)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #8
0
        public int AddNotepad(string title, string content)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_notepad(Title,CreateTime,UpdateTime,Content)values(@Title,@CreateTime,@UpdateTime,@Content)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Title",title),
                                         new SQLiteParameter("@CreateTime",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                                         new SQLiteParameter("@UpdateTime",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                                         new SQLiteParameter("@Content",content)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch (Exception)
            {
                throw;
            }
            return result;
        }
Example #9
0
        public DataTable GetCityInfoByCode(string code)
        {
            DataTable data = new DataTable();
            try
            {
                string sqlString = string.Format("select *  from t_city where Code='{0}'", code);

                SqlAction action = new SqlAction();
                data = action.DataTableQuery(sqlString, null);
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString());
            }
            return data;
        }
        public int InsertCityData(City city)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_city(Name,ShengParent,ShiParent,Code)values(@Name,@ShengParent,@ShiParent,@Code)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Name",city.Name),
                                         new SQLiteParameter("@ShengParent",city.ShengParent),
                                         new SQLiteParameter("@ShiParent",city.ShiParent),
                                         new SQLiteParameter("@Code",city.Code)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString());
            }
            return result;
        }
 /// <summary>
 /// 获取当前"网址设置表"数据
 /// </summary>
 /// <returns></returns>
 public DataTable GetWebsiteConfig()
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_website_config order by WebOrder";
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, null);
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
     return data;
 }
Example #12
0
        public int AddTimedEvent(TimedEvent timerEvent)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_dingshi(Id,Frequency,Time,ExecEvents,FilePath)values(@Id,@Frequency,@Time,@ExecEvents,@FilePath)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Id",timerEvent.Id),
                                         new SQLiteParameter("@Frequency",timerEvent.Frequency),
                                         new SQLiteParameter("@Time",timerEvent.Time.ToString("yyyy-MM-dd HH:mm:ss")),
                                         new SQLiteParameter("@ExecEvents",timerEvent.ExecEvents),
                                         new SQLiteParameter("@FilePath",timerEvent.FilePath)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #13
0
        public int DeleteReminderExpired(DateTime now)
        {
            int result = 0;
            try
            {
                string sql = "delete from t_tixing where Time < @Time";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Time",now.ToString("yyyy-MM-dd HH:mm:ss"))
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
        public int InsertWebsiteData(Website website)
        {
            int result = 0;
            try
            {
                string sql = "INSERT INTO t_website(WebOrder,Type,Name,URL)values(@WebOrder,@Type,@Name,@URL)";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@WebOrder",website.Index),
                                         new SQLiteParameter("@Type",website.Type),
                                         new SQLiteParameter("@Name",website.Name),
                                         new SQLiteParameter("@URL",website.Url)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString());
            }
            return result;
        }
Example #15
0
        public DataTable GetTimedEvents()
        {
            DataTable data = new DataTable();
            try
            {
                string sqlString = @"select *  from t_dingshi";

                SqlAction action = new SqlAction();
                data = action.DataTableQuery(sqlString, null);
            }
            catch
            {
            }
            return data;
        }
Example #16
0
 public DataTable GetNotepadByCreateTime(string createTime)
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select CreateTime,Title,Content from t_notepad  where CreateTime=@CreateTime";
         SQLiteParameter[] parameters = new SQLiteParameter[]{
                                  new SQLiteParameter("@CreateTime",createTime)
                                  };
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, parameters);
     }
     catch (Exception)
     {
         throw;
     }
     return data;
 }
Example #17
0
        public int DeleteNotepad(string createTime)
        {
            int result = 0;
            try
            {
                string sql = "delete from t_notepad where CreateTime=@CreateTime";
                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@CreateTime",createTime)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch (Exception)
            {

                throw;
            }
            return result;
        }
Example #18
0
        public DataTable GetNotepad()
        {
            DataTable data = new DataTable();
            try
            {
                string sqlString = @"select CreateTime,Title  from t_notepad order by UpdateTime";

                SqlAction action = new SqlAction();
                data = action.DataTableQuery(sqlString, null);
            }
            catch (Exception)
            {
                throw;
            }
            return data;
        }
Example #19
0
 public DataTable GetConfig()
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_config";
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, null);
     }
     catch
     {
     }
     return data;
 }
Example #20
0
        public int DeleteTimedEvent(int id)
        {
            int result = 0;
            try
            {
                string sql = string.Empty;
                SQLiteParameter[] parameters = null;

                if (-1 == id)
                {
                    sql = "delete from t_dingshi where Frequency='仅一次' and Time < @Time";
                    parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Time",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
                                         };
                }
                else
                {
                    sql = "delete from t_dingshi where Id = @Id";
                    parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Id",id)
                                         };
                }
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #21
0
        public int UpdateConfig(string name, string value)
        {
            int result = 0;
            try
            {
                string sql = "update t_config set Value=@Value where  Name=@Name";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Name",name),
                                         new SQLiteParameter("@Value",value)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #22
0
        public int UpdateNotepad(string createTime, string title, string content)
        {
            int result = 0;
            try
            {
                string sql = "update t_notepad set Title=@Title,UpdateTime=@UpdateTime,Content=@Content where CreateTime=@CreateTime";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Title",title),
                                         new SQLiteParameter("@CreateTime",createTime),
                                         new SQLiteParameter("@UpdateTime",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                                         new SQLiteParameter("@Content",content)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch (Exception)
            {
                throw;
            }
            return result;
        }
Example #23
0
 public DataTable GetReminders(DateTime now)
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_tixing where Time >= @Time order by Id";
         SQLiteParameter[] parameters = new SQLiteParameter[]{
                                  new SQLiteParameter("@Time",now.ToString("yyyy-MM-dd HH:mm:ss"))
                                  };
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, parameters);
     }
     catch
     {
     }
     return data;
 }
Example #24
0
        public int DeleteReminderById(int id)
        {
            int result = 0;
            try
            {
                string sql = "delete from t_tixing where Id = @Id";

                SQLiteParameter[] parameters = new SQLiteParameter[]{
                                         new SQLiteParameter("@Id",id)
                                         };
                SqlAction action = new SqlAction();
                result = action.IntQuery(sql, parameters);
            }
            catch
            {
            }
            return result;
        }
Example #25
0
 public DataTable GetCityData(CityType type, string parent)
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = string.Empty;
         SQLiteParameter[] parameters = null;
         City city = new City();
         switch (type)
         {
             case CityType.Sheng:
                 sqlString = "select Name  from t_city where ShengParent IS NULL and ShiParent IS NULL and Code IS NULL";
                 break;
             case CityType.Shi:
                 sqlString = "select Name  from t_city where ShengParent=@ShengParent and ShiParent IS NULL and Code IS NULL";
                 parameters = new SQLiteParameter[]{
                                  new SQLiteParameter("@ShengParent",parent)
                                  };
                 break;
             case CityType.Xian:
                 sqlString = "select Name,Code  from t_city where ShiParent=@ShiParent";
                 parameters = new SQLiteParameter[]{
                                  new SQLiteParameter("@ShiParent",parent)
                                  };
                 break;
         }
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, parameters);
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
     return data;
 }
Example #26
0
 public DataTable GetRiliDataByMonth(int year,int month)
 {
     DataTable data = new DataTable();
     try
     {
         string sqlString = @"select *  from t_rili where Yangli like '" + string.Format("{0}年{1}月",year,month) + "%' order by Yangli";
         SqlAction action = new SqlAction();
         data = action.DataTableQuery(sqlString, null);
     }
     catch
     {
     }
     return data;
 }