Exemple #1
0
        public List <SynModel> getUploadCommands(String sql)
        {
            List <SynModel> list = null;

            using (SQLiteDataReader rdr = SQLiteHelper.ExecuteReader(SQLiteHelper.ConnectionStringLocalTransaction, CommandType.Text, sql))
            {
                while (rdr.Read())
                {
                    if (list == null)
                    {
                        list = new List <SynModel>();
                    }
                    SynModel item = new SynModel();
                    item.Id      = rdr["id"] == DBNull.Value ? 0 : Convert.ToInt32(rdr["id"]);
                    item.Command = rdr["command"] == DBNull.Value ? "" : rdr["command"].ToString();
                    list.Add(item);
                }
            }

            return(list);
        }
Exemple #2
0
        public List <SynModel> getDownloadCommands(String sql)
        {
            List <SynModel> items = new List <SynModel>();

            using (
                MySqlDataReader rdr = Tools.MySqlHelper.ExecuteReader(
                    Tools.MySqlHelper.ConnectionStringLocalTransaction, CommandType.Text, sql))
            {
                while (rdr.Read())
                {
                    if (items == null)
                    {
                        items = new List <SynModel>();
                    }
                    SynModel item = new SynModel();
                    item.Id      = rdr["id"] == DBNull.Value ? 0 : Convert.ToInt32(rdr["id"]);
                    item.Command = rdr["command"] == DBNull.Value ? "" : rdr["command"].ToString();
                    items.Add(item);
                }
            }
            return(items);
        }