protected void Page_Load(object sender, EventArgs e) { SearchCriterion.SetOrder("BlockType"); if (!string.IsNullOrEmpty(this.RequestData.Get <string>("BlockType"))) { ents = WebPartRule.FindAll(SearchCriterion, Expression.Eq("BlockType", this.RequestData.Get <string>("BlockType"))); } else { ents = WebPartRule.FindAll(SearchCriterion, Expression.Eq("BlockType", "portal")); } this.PageState.Add("WebPartList", ents); this.PageState.Add("BlockType", SysEnumeration.GetEnumDict("BlockType")); Aim.Portal.Model.WebPart ent = null; switch (this.RequestAction) { case RequestActionEnum.Insert: ent = this.GetPostedData <Aim.Portal.Model.WebPart>(); ent.Create(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Update: ent = this.GetMergedData <Aim.Portal.Model.WebPart>(); ent.Update(); this.SetMessage("保存成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <Aim.Portal.Model.WebPart>(); ent.Delete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { if (RequestActionString == "batchdelete") { WebPartRule.BatchRemoveByPrimaryKeys(idList); } } break; } }
protected void Page_Load(object sender, EventArgs e) { ents = WebPartRule.FindAll(SearchCriterion); this.PageState.Add("WebPartList", ents); Aim.Portal.Model.WebPart ent = null; switch (this.RequestAction) { case RequestActionEnum.Insert: ent = this.GetPostedData <Aim.Portal.Model.WebPart>(); ent.Create(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Update: ent = this.GetMergedData <Aim.Portal.Model.WebPart>(); ent.Update(); this.SetMessage("保存成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <Aim.Portal.Model.WebPart>(); ent.Delete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Execute: DataHelper.ExecSql(" delete from WebPartTemplate where isnull(UserID,'')<>'' and IsDefault='T' and BlockType='Portal'"); break; case RequestActionEnum.Custom: IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { if (RequestActionString == "batchdelete") { WebPartRule.BatchRemoveByPrimaryKeys(idList); } } break; } }
protected void Page_Load(object sender, EventArgs e) { ents = WebPartRule.FindAll(SearchCriterion); this.PageState.Add("WebPartList", ents); Aim.Portal.Model.WebPart ent = null; switch (this.RequestAction) { case RequestActionEnum.Insert: ent = this.GetPostedData <Aim.Portal.Model.WebPart>(); ent.Create(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Update: ent = this.GetMergedData <Aim.Portal.Model.WebPart>(); ent.Update(); this.SetMessage("保存成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <Aim.Portal.Model.WebPart>(); ent.Delete(); this.SetMessage("删除成功!"); break; case RequestActionEnum.Custom: IList <object> idList = RequestData.GetList <object>("IdList"); if (idList != null && idList.Count > 0) { if (RequestActionString == "batchdelete") { WebPartRule.BatchRemoveByPrimaryKeys(idList); } } break; default: DoSelect(); break; } }