string type = String.Empty; // 对象类型 #endregion #region ASP.NET 事件 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); DynamicPermission ent = null; switch (this.RequestAction) { case RequestActionEnum.Update: ent = this.GetMergedData <DynamicPermission>(); ent.DoUpdate(); this.SetMessage("修改成功!"); break; case RequestActionEnum.Create: ent = this.GetPostedData <DynamicPermission>(); ent.CreaterID = UserInfo.UserID; ent.CreaterName = UserInfo.Name; ent.DoCreate(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <DynamicPermission>(); ent.DoDelete(); this.SetMessage("删除成功!"); return; } }
protected void Page_Load(object sender, EventArgs e) { ents = DynamicPermissionRule.FindAll(SearchCriterion); this.PageState.Add("DynamicPermissionList", ents); DynamicPermission ent = null; switch (this.RequestAction) { case RequestActionEnum.Create: ent = this.GetPostedData <DynamicPermission>(); ent.DoCreate(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Update: ent = this.GetMergedData <DynamicPermission>(); ent.DoUpdate(); this.SetMessage("保存成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <DynamicPermission>(); ent.DoDelete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { if (RequestActionString == "batchdelete") { DynamicPermissionRule.BatchRemoveByPrimaryKeys(idList); } } break; } }