コード例 #1
0
        /*
         * 获取父栏目中最大的排序号
         */
        public StorageVideoFolder getMaxIdxByParentId(int parentId)
        {
            String sql = "select max(idx) as idx from storageVideoFolder where parentId=@parentId";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@parentId", DbType.Int32, 4)
            };
            parameters[0].Value = parentId;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            StorageVideoFolder entity = DataToEntity <StorageVideoFolder> .FillModel(dt.Rows[0]);

            return(entity);
        }
コード例 #2
0
        /*
         * 获取子文件夹
         */
        public List <StorageVideoFolder> getByParentId(int parentId)
        {
            String sql = "select * from storageVideoFolder where parentId=@parentId  order by idx asc";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@parentId", DbType.Int32, 4)
            };
            parameters[0].Value = parentId;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            List <StorageVideoFolder> list = DataToEntity <StorageVideoFolder> .FillModel(dt);

            return(list);
        }
        public List <StorageImage> getNextPage2(int currPage, int pageSize)
        {
            int start = (currPage - 1) * pageSize;
            int end   = currPage * pageSize;

            String sql = "select * from storageImage   order by id desc limit @start,@end";

            SQLiteParameter[] parameters = new SQLiteParameter[2];
            parameters[0]       = new SQLiteParameter("@start", DbType.Int32, 4);
            parameters[1]       = new SQLiteParameter("@end", DbType.Int32, 4);
            parameters[0].Value = start;
            parameters[1].Value = end;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            List <StorageImage> list = DataToEntity <StorageImage> .FillModel(dt);

            return(list);
        }
        //获取图片列表
        public List <TurnPictureImagesDto> getByDControlId(int dControlId)
        {
            String sql = "select a.*,b.url from turnPictureImages a left join storageImage b on a.storageImageId=b.id where a.dControlId=@dControlId order by a.id asc";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@dControlId", DbType.Int32, 4)
            };
            parameters[0].Value = dControlId;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            if (dt == null)
            {
                return(new List <TurnPictureImagesDto>());
            }
            List <TurnPictureImagesDto> list = DataToEntity <TurnPictureImagesDto> .FillModel(dt);

            return(list);
        }
        //获取文件
        public StorageFile get(Int32 id)
        {
            String sql = "select * from storageFile where id=@id";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@id", DbType.Int32, 4)
            };
            parameters[0].Value = id;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            if (dt == null || dt.Rows.Count == 0)
            {
                return(null);
            }
            StorageFile storageFile = DataToEntity <StorageFile> .FillModel(dt.Rows[0]);

            return(storageFile);
        }
        public List <StorageFile> getNextPageOfWord(int currPage, int pageSize, int folderId)
        {
            int    start = (currPage - 1) * pageSize;
            String sql   = "select * from storageFile where   folderId=@folderId  order by id desc limit @start,@pageSize";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@start",    DbType.Int32, 4),
                new SQLiteParameter("@pageSize", DbType.Int32, 4),
                new SQLiteParameter("@folderId", DbType.Int32, 4)
            };
            parameters[0].Value = start;
            parameters[1].Value = pageSize;
            parameters[2].Value = folderId;

            DataTable          dt   = Common.SQLiteHelper.ExecuteQuery(sql, parameters);
            List <StorageFile> list = DataToEntity <StorageFile> .FillModel(dt);

            return(list);
        }
コード例 #7
0
        /*
         * 获取控件
         */
        public DControl get(int id)
        {
            String sql = "select * from dControl where id=@id";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@id", DbType.Int32, 4)
            };
            parameters[0].Value = id;

            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            if (dt == null)
            {
                return(null);
            }

            DControl dControl = DataToEntity <DControl> .FillModel(dt.Rows[0]);

            return(dControl);
        }
コード例 #8
0
        /*
         * 获取轮播图片在某个屏幕对应的跳转
         */
        public DControlEvent getByTurnPictureImagesIdScreenCfgId(int turnPictureImagesId, int screenCfgId)
        {
            String sql = "select * from dControlEvent where turnPictureImagesId=@turnPictureImagesId and screenCfgId=@screenCfgId ";

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@turnPictureImagesId", DbType.Int32, 4),
                new SQLiteParameter("@screenCfgId",         DbType.Int32, 4)
            };
            parameters[0].Value = turnPictureImagesId;
            parameters[1].Value = screenCfgId;
            DataTable dt = Common.SQLiteHelper.ExecuteQuery(sql, parameters);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return(null);
            }

            DControlEvent entity = DataToEntity <DControlEvent> .FillModel(dt.Rows[0]);

            return(entity);
        }