protected void Page_Load(object sender, EventArgs e) { string userId = this.UserInfo.UserID; if (this.Request["DeptId"] == null && this.Request["IsDeptManage"] == "T") { string deptId = "select DeptId from V_FactDept where UserId='" + this.UserInfo.UserID + "'"; deptId = DataHelper.QueryValue <string>(deptId); if (deptId == null) { Response.Write("没有获取到用户的所在部门信息!"); Response.End(); } else { if (DataHelper.QueryValue("select Id from dbo.WebPartTemplate where BlockType='DeptPortal' and BaseTemplateId='" + deptId + "'") == null) { Response.Write("部门门户尚未开启,请联系管理员开启部门门户!"); Response.End(); //throw new Exception(""); } Response.Redirect("/Home.aspx?&Redirect=T&IsManage=T&BlockType=DeptPortal&DeptId=" + deptId); } } Html = WebPartRule.GetBlocks(userId, this.UserInfo.LoginName, ref LayoutXML, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); }
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; } }
protected void Page_Load(object sender, EventArgs e) { string userId = this.UserInfo.UserID; Html = WebPartRule.GetBlocks(userId, this.UserInfo.LoginName, ref LayoutXML, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); }
protected void Page_Load(object sender, EventArgs e) { string userId = UserInfo != null ? UserInfo.UserID : ""; string reqAction = this.Request["Param"]; switch (reqAction) { //获取各个块内容 case "GetContent": string blockId = this.Request["BlockId"]; Aim.Portal.Model.WebPart part = Aim.Portal.Model.WebPart.Find(blockId); WebPartExt bl = new WebPartExt(part, blockId); part.RepeatItemCount = int.Parse(this.Request["Count"]); content = GetBlockContent(reqAction, part, bl); break; case "GetAllBlock": content = WebPartRule.GetAllBlockNames(userId, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"], ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(typeof(ActiveRecordBase)).Connection.Database); break; case "GetOneNew": content = WebPartRule.GetOneBlockHtmls(this.Request["BlockId"], userId); WebPartRule.UpdateAfterAddNewOneBlock(userId, this.Request["BlockId"], this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); break; case "DeleteBlock": WebPartRule.DeleteBlockFromTemplate(userId, this.Request["BlockId"], this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); break; case "SaveOrder": //保存页面布局 string orders = this.Request["Orders"]; WebPartRule.SaveGetBlocks(userId, orders, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); break; case "BlockParam": content = WebPartRule.GetUserBlock(userId, this.Request["BlockId"], this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); break; case "BlockUpdate": string blocktitle = this.Request["blocktitle"]; string blockrow = this.Request["blockrow"]; string subjectlength = this.Request["subjectlength"]; string blocktpl = this.Request["blocktpl"]; string blockcolorvalue = Server.HtmlDecode(this.Request["colorvalue"]); string blockid = this.Request["blockid"]; WebPartRule.UpdateUserBlock(userId, blockid, blocktitle, blockrow, subjectlength, blocktpl, blockcolorvalue, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"]); break; case "GetOneOld": content = WebPartRule.GetOneBlockHtmls(userId, this.Request["BlockId"], this.Request["BlockType"]); break; case "ChangeColumns": string columns = this.Request["Columns"]; string layout1 = this.Request["layout1"]; string layout2 = this.Request["layout2"]; string layout3 = this.Request["layout3"]; string layout4 = this.Request["layout4"]; string templateString = this.Request["TemplateString"]; WebPartRule.ChangeColumns(userId, columns, templateString, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"], layout1, layout2, layout3, layout4); break; case "ChangeWidth": string columns1 = this.Request["Columns"]; string layout11 = this.Request["layout1"]; string layout21 = this.Request["layout2"]; string layout31 = this.Request["layout3"]; string layout41 = this.Request["layout4"]; WebPartRule.ChangeColumnsWidth(userId, columns1, this.Request["BlockType"], this.Request["TemplateId"], this.Request["IsManage"], layout11, layout21, layout31, layout41); break; case "Reset": content = Reset(); break; default: content = ""; break; #region 主页功能部分 /* * case "SetGlobalColor": * Block.SetGlobalColor(this.UserState.UserId, this.Request["Color"], Server.HtmlDecode(this.Request["ColorValue"]), this.Request["BlockType"], this.RequestDs["TemplateId", ""], this.RequestDs["IsManage", ""]); * this.SysColor = this.Request["Color"]; * break; * case "GetIcons": * content = Block.GetIcons(); * break; * case "SetIcon": * Block.SetIcon(this.UserState.UserId, this.Request["BlockId"], this.Request["BlockType"], this.Request["BlockImg"], this.RequestDs["TemplateId", ""], this.RequestDs["IsManage", ""]); * break; * case "MyRss": * content = MyRss(); * break; */ #endregion case "Menu": string appId = this.Request["AppId"]; InitSubMenu(appId); break; } Response.Write(content); Response.End(); }