Beispiel #1
0
        string pt = String.Empty; // 父模块类型

        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op"); // 用户编辑操作
            id = RequestData.Get <string>("id");
            pt = RequestData.Get <string>("pt");

            SysRole ent = null;

            if (IsAsyncRequest)
            {
                switch (RequestAction)
                {
                case RequestActionEnum.Query:
                case RequestActionEnum.Read:
                case RequestActionEnum.Default:
                    break;

                case RequestActionEnum.Create:
                    ent      = this.GetPostedData <SysRole>();
                    ent.Type = 4;
                    ent.DoCreate();
                    break;

                case RequestActionEnum.Update:
                    ent = this.GetMergedData <SysRole>();
                    ent.DoUpdate();
                    break;

                case RequestActionEnum.Delete:
                    ent = this.GetTargetData <SysRole>();
                    ent.DoDelete();
                    break;
                }
            }
            else
            {
                if (op != "c")
                {
                    if (!String.IsNullOrEmpty(id))
                    {
                        ent = SysRole.Find(id);
                    }
                }
            }

            DataEnum de = SysRoleTypeRule.GetRoleTypeEnum();

            this.PageState.Add("RolTypeEnum", de);

            this.SetFormData(ent);
        }