Exemple #1
0
        public dynamic GetSearchListByPage(string searchKey, int pageSize = 10, int pageIndex = 1, SortName sortName = SortName.CreateTime)
        {
            List <VideoView> videolist = new List <VideoView>();
            int _totalcount            = 0;

            if (string.IsNullOrEmpty(searchKey))
            {
                return(new { msg = LanguageUtil.Translate("api_Controller_Video_GetSearchListByPage_msg") });
            }
            try
            {
                videolist = _videoBusiness.SearchVideoByPage(searchKey, out _totalcount, pageSize, pageIndex, sortName);
                int _totalPage = (int)Math.Ceiling(_totalcount / (pageSize * 1.0));
                return(new { msg = "success", page = new { totalNum = _totalcount, totalPage = _totalPage }, listdata = videolist });
            }
            catch (Exception ex)
            {
                return(new { msg = ex.Message });
            }
        }