protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Request.QueryString["infoid"], out this.infoId)) { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'info_manager.aspx';</script>"); return; } this.articleManager = new ArticleManager("EFConnectionString"); this.article = this.articleManager.Get(this.infoId) as ArticleEntity; NodeManager nodeManager = new NodeManager("EFConnectionString"); NodeEntity node = nodeManager.Get(this.article.NodeId); StringDictionary roles = (this.Master as AdminLayout).UserRoles; if (!nodeManager.CheckNodeRole(node, roles, ActionType.ManageInfo)) { this.Response.Write("<script>alert('无权限!');</script>"); this.Response.Write("<script>window.location = 'info_manager.aspx';</script>"); return; } if (!this.IsPostBack) { this.title.Text = this.article.Title; this.content.Text = this.article.Content; this.source.Text = this.article.Source; this.image.Text = this.article.Image; this.link.Text = this.article.Link; this.isTop.Checked = this.article.IsTop; this.stateList.SelectedIndex = (int)this.article.State; } }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Request.QueryString["nodeid"], out this.nodeId)) { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'node_manager.aspx';</script>"); return; } this.nodeManager = new NodeManager("EFConnectionString"); this.node = this.nodeManager.Get(this.nodeId); StringDictionary roles = (this.Master as AdminLayout).UserRoles; if (!nodeManager.CheckNodeRole(node, roles, ActionType.ManageNode)) { this.Response.Write("<script>alert('无权限!');</script>"); this.Response.Write("<script>window.location = 'node_manager.aspx';</script>"); return; } if (!this.IsPostBack) { this.nodeName.Text = this.node.NodeName; this.imagePath.Text = this.node.ImagePath; this.needAudit.Checked = this.node.NeedAudit; this.comment.Text = this.node.Comment; this.enable.Checked = this.node.Enable; this.addNodeLink.NavigateUrl += this.nodeId.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.Request.QueryString["nodeid"])) { NodeManager nodeManager = new NodeManager("EFConnectionString"); nodeManager.FillTreeView(nodeTreeView, (this.Master as AdminLayout).UserRoles, ActionType.ManageInfo, "add_info.aspx?nodeid="); } else { int nodeId; if (!int.TryParse(this.Request.QueryString["nodeid"], out nodeId)) { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'add_info.aspx';</script>"); return; } NodeManager nodeManager = new NodeManager("EFConnectionString"); NodeEntity node = nodeManager.Get(nodeId); if (string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings[string.Format(addPageString, node.ApplicationId.ToString())])) { this.Response.Write("<script>alert('配置出错!请联系程序猿!');</script>"); this.Response.Write("<script>window.location = 'add_info.aspx';</script>"); } else { this.Response.Redirect(ConfigurationManager.AppSettings[string.Format(addPageString, node.ApplicationId.ToString())] + "?nodeid=" + nodeId); } } }
protected void Page_Load(object sender, EventArgs e) { int id; if (int.TryParse(this.Request.QueryString["nodeid"], out id)) { NodeManager nodeManager = new NodeManager("EFConnectionString"); NodeEntity node = nodeManager.Get(id); StringDictionary roles = (this.Master as AdminLayout).UserRoles; if (!nodeManager.CheckNodeRole(node, roles, ActionType.ManageNode)) { this.Response.Write("<script>alert('无权限!');</script>"); this.Response.Write("<script>window.location = 'info_manager.aspx';</script>"); return; } int infoCount; if (node.ApplicationId == 3) { InfoManager infoManager = new InfoManager("EFConnectionString"); this.infosView.DataSource = infoManager.GetByNodeId(id, true, int.Parse(this.pageIndex.Value), int.Parse(this.pageSize.Value), out infoCount); } else { infoCount = 0; } this.infoCount.Value = infoCount.ToString(); this.infosView.DataBind(); } else if (int.TryParse(this.Request.QueryString["infoid"], out id)) { InfoManager infoManager = new InfoManager("EFConnectionString"); InfoEntity info = infoManager.Get(id); int nodeId = info.NodeId; NodeManager nodeManager = new NodeManager("EFConnectionString"); NodeEntity node = nodeManager.Get(nodeId); if (string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings[string.Format(updatePageString, node.ApplicationId.ToString())])) { this.Response.Write("<script>alert('配置出错!请联系程序猿!');</script>"); this.Response.Write("<script>window.location = 'info_manager.aspx';</script>"); } else { this.Response.Redirect(ConfigurationManager.AppSettings[string.Format(updatePageString, node.ApplicationId.ToString())] + "?infoid=" + id); } } else { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'info_manager.aspx';</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Request.QueryString["parentid"], out parentId)) { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'node_manager.aspx';</script>"); return; } this.nodeManager = new NodeManager("EFConnectionString"); NodeEntity parentNode = this.nodeManager.Get(this.parentId); this.roles = (this.Master as AdminLayout).UserRoles; if (!nodeManager.CheckNodeRole(parentNode, this.roles, ActionType.ManageNode)) { this.Response.Write("<script>alert('无权限!');</script>"); this.Response.Write("<script>window.location = 'node_manager.aspx';</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Request.QueryString["nodeid"], out nodeId)) { this.Response.Write("<script>alert('参数错误!');</script>"); this.Response.Write("<script>window.location = 'add_info.aspx';</script>"); return; } NodeManager nodeManager = new NodeManager("EFConnectionString"); this.node = nodeManager.Get(this.nodeId); StringDictionary roles = (this.Master as AdminLayout).UserRoles; if (!nodeManager.CheckNodeRole(node, roles, ActionType.AddInfo)) { this.Response.Write("<script>alert('无权限!');</script>"); this.Response.Write("<script>window.location = 'add_info.aspx';</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { NodeManager nodeManager = new NodeManager("EFConnectionString"); nodeManager.FillTreeView(nodeTreeView, (this.Master as AdminLayout).UserRoles, ActionType.ManageInfo, "info_list.aspx?nodeid="); }