Esempio n. 1
0
        private void Bind()
        {
            GetSearchItem();

            int totalRecords         = 0;
            ActivityPhotoPicture bll = new ActivityPhotoPicture();

            rpData.DataSource = bll.GetList(pageIndex, pageSize, out totalRecords, sqlWhere, parms == null ? null : parms.ToArray());
            rpData.DataBind();

            myDataAppend += "<div id=\"myDataForPage\" style=\"display:none;\">[{\"PageIndex\":\"" + pageIndex + "\",\"PageSize\":\"" + pageSize + "\",\"TotalRecord\":\"" + totalRecords + "\",\"QueryStr\":\"" + queryStr + "\"}]</div>";
        }
        private void Bind()
        {
            if (!string.IsNullOrEmpty(funName))
            {
                int totalRecords = 0;
                switch (funName)
                {
                case "CommunionPicture":
                    CommunionPicture communionpBll = new CommunionPicture();
                    rpData.DataSource = communionpBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                case "UserHeadPicture":
                    UserHeadPicture uhpBll = new UserHeadPicture();
                    rpData.DataSource = uhpBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                case "ActivityPhotoPicture":
                    ActivityPhotoPicture appBll = new ActivityPhotoPicture();
                    rpData.DataSource = appBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                case "ActivityPlayerPhotoPicture":
                    ActivityPlayerPhotoPicture apppBll = new ActivityPlayerPhotoPicture();
                    rpData.DataSource = apppBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                case "PictureScratchLotto":
                    PictureScratchLotto pslBll = new PictureScratchLotto();
                    rpData.DataSource = pslBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                case "InformationPicture":
                    PictureInformation piBll = new PictureInformation();
                    rpData.DataSource = piBll.GetList(pageIndex, pageSize, out totalRecords, "", null);
                    rpData.DataBind();
                    break;

                default:
                    break;
                }

                myDataAppend.Replace("{TotalRecord}", totalRecords.ToString());
                myDataAppend.Replace("{PageIndex}", pageIndex.ToString());
                myDataAppend.Replace("{PageSize}", pageSize.ToString());
            }
        }