Ejemplo n.º 1
0
        public ActionResult VideoList()
        {
            List <VideoDTO> model = new List <VideoDTO>();

            model = bll.GetVideoList();
            return(View(model));
        }
Ejemplo n.º 2
0
    protected void dataBind(string where)
    {
        try
        {
            int PageCurrent = Convert.ToInt32(this.AspNetPager1.CurrentPageIndex);
            int PageNum     = 20;
            int TotalCount  = 1;
            int PageCount   = 1;
            AspNetPager1.PageSize = PageNum;
            DataTable dt = bll.GetVideoList("VideoInfo", "Id", "*", where, "Id desc", ref PageCurrent, PageNum, ref TotalCount);
            if (dt != null)
            {
                this.AspNetPager1.RecordCount = Convert.ToInt32(TotalCount);
                this.VideoList.DataSource     = dt.DefaultView;

                this.VideoList.DataBind();

                if (TotalCount % PageNum > 0)
                {
                    PageCount = TotalCount / PageNum + 1;
                }
                else
                {
                    PageCount = TotalCount / PageNum;
                }
                this.pinfo.InnerText = Convert.ToString(TotalCount);//总条数
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }