} //页面权限,如:CMS_内容管理_列表页;注意:这里直接使用按钮权限进行配置,请根据实际情况设置 /*权限配置结束*/ protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { JSoft.BLL.SA.Tree bll = new JSoft.BLL.SA.Tree(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int NodeID = (Convert.ToInt32(Request.Params["id"])); bll.Delete(NodeID); Response.Redirect("list.aspx"); } } }
private void ShowInfo(int NodeID) { JSoft.BLL.SA.Tree bll = new JSoft.BLL.SA.Tree(); JSoft.Model.SA.Tree model = bll.GetModel(NodeID); this.lblNodeID.Text = model.NodeID.ToString(); this.lblTreeText.Text = model.TreeText; this.lblParentID.Text = model.ParentID.ToString(); this.lblParentPath.Text = model.ParentPath; this.lblLocation.Text = model.Location; this.lblOrderID.Text = model.OrderID.ToString(); this.lblComment.Text = model.Comment; this.lblUrl.Text = model.Url; this.lblPermissionID.Text = model.PermissionID.ToString(); this.lblImageUrl.Text = model.ImageUrl; this.lblModuleID.Text = model.ModuleID.ToString(); this.lblKeShiDM.Text = model.KeShiDM.ToString(); this.lblKeshiPublic.Text = model.KeshiPublic; this.lblTreeType.Text = model.TreeType.ToString(); this.lblEnabled.Text = model.Enabled?"是":"否"; }
private void ShowInfo(int NodeID) { JSoft.BLL.SA.Tree bll = new JSoft.BLL.SA.Tree(); JSoft.Model.SA.Tree model = bll.GetModel(NodeID); this.lblNodeID.Text = model.NodeID.ToString(); this.txtTreeText.Text = model.TreeText; this.txtParentID.Text = model.ParentID.ToString(); this.txtParentPath.Text = model.ParentPath; this.txtLocation.Text = model.Location; this.txtOrderID.Text = model.OrderID.ToString(); this.txtComment.Text = model.Comment; this.txtUrl.Text = model.Url; this.txtPermissionID.Text = model.PermissionID.ToString(); this.txtImageUrl.Text = model.ImageUrl; this.txtModuleID.Text = model.ModuleID.ToString(); this.txtKeShiDM.Text = model.KeShiDM.ToString(); this.txtKeshiPublic.Text = model.KeshiPublic; this.txtTreeType.Text = model.TreeType.ToString(); this.chkEnabled.Checked = model.Enabled; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtTreeText.Text.Trim().Length == 0) { strErr += "TreeText不能为空!\\n"; } if (!PageValidate.IsNumber(txtParentID.Text)) { strErr += "ParentID格式错误!\\n"; } if (this.txtParentPath.Text.Trim().Length == 0) { strErr += "ParentPath不能为空!\\n"; } if (this.txtLocation.Text.Trim().Length == 0) { strErr += "Location不能为空!\\n"; } if (!PageValidate.IsNumber(txtOrderID.Text)) { strErr += "OrderID格式错误!\\n"; } if (this.txtComment.Text.Trim().Length == 0) { strErr += "Comment不能为空!\\n"; } if (this.txtUrl.Text.Trim().Length == 0) { strErr += "Url不能为空!\\n"; } if (!PageValidate.IsNumber(txtPermissionID.Text)) { strErr += "PermissionID格式错误!\\n"; } if (this.txtImageUrl.Text.Trim().Length == 0) { strErr += "ImageUrl不能为空!\\n"; } if (!PageValidate.IsNumber(txtModuleID.Text)) { strErr += "ModuleID格式错误!\\n"; } if (!PageValidate.IsNumber(txtKeShiDM.Text)) { strErr += "KeShiDM格式错误!\\n"; } if (this.txtKeshiPublic.Text.Trim().Length == 0) { strErr += "KeshiPublic不能为空!\\n"; } if (!PageValidate.IsNumber(txtTreeType.Text)) { strErr += "TreeType格式错误!\\n"; } if (strErr != "") { MessageBox.ShowFailTip(this, strErr); return; } string TreeText = this.txtTreeText.Text; int ParentID = int.Parse(this.txtParentID.Text); string ParentPath = this.txtParentPath.Text; string Location = this.txtLocation.Text; int OrderID = int.Parse(this.txtOrderID.Text); string Comment = this.txtComment.Text; string Url = this.txtUrl.Text; int PermissionID = int.Parse(this.txtPermissionID.Text); string ImageUrl = this.txtImageUrl.Text; int ModuleID = int.Parse(this.txtModuleID.Text); int KeShiDM = int.Parse(this.txtKeShiDM.Text); string KeshiPublic = this.txtKeshiPublic.Text; int TreeType = int.Parse(this.txtTreeType.Text); bool Enabled = this.chkEnabled.Checked; JSoft.Model.SA.Tree model = new JSoft.Model.SA.Tree(); model.TreeText = TreeText; model.ParentID = ParentID; model.ParentPath = ParentPath; model.Location = Location; model.OrderID = OrderID; model.Comment = Comment; model.Url = Url; model.PermissionID = PermissionID; model.ImageUrl = ImageUrl; model.ModuleID = ModuleID; model.KeShiDM = KeShiDM; model.KeshiPublic = KeshiPublic; model.TreeType = TreeType; model.Enabled = Enabled; JSoft.BLL.SA.Tree bll = new JSoft.BLL.SA.Tree(); bll.Add(model); JSoft.Common.MessageBox.ShowSuccessTip(this, "保存成功!", "add.aspx"); /*增加日志*/ LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("Add:【{0}】", new JavaScriptSerializer().Serialize(model)), this); }