protected void Page_Load(object sender, EventArgs e)
        {
            if (SearchCriterion.Orders.Count <= 0)
            {
                SearchCriterion.SetOrder("SortIndex");
                SearchCriterion.SetOrder("CreatedDate");
            }

            ents = DynamicPermissionCatalogRule.FindAll(SearchCriterion);

            this.PageState.Add("DtList", ents);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ents = DynamicPermissionCatalogRule.FindAll(SearchCriterion);

            this.PageState.Add("DynamicPermissionCatalogList", ents);

            DynamicPermissionCatalog ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Create:
                ent = this.GetPostedData <DynamicPermissionCatalog>();
                ent.DoCreate();
                this.SetMessage("新建成功!");
                break;

            case RequestActionEnum.Update:
                ent = this.GetMergedData <DynamicPermissionCatalog>();
                ent.DoUpdate();
                this.SetMessage("保存成功!");
                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <DynamicPermissionCatalog>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            case RequestActionEnum.Custom:
                IList <object> idList = RequestData.GetList <object>("IdList");

                if (idList != null && idList.Count > 0)
                {
                    if (RequestActionString == "batchdelete")
                    {
                        DynamicPermissionCatalogRule.BatchRemoveByPrimaryKeys(idList);
                    }
                }
                break;
            }
        }