Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                this.id = base.Request.Params["id"];
                if ((this.id == null) || (this.id.Trim() == ""))
                {
                    base.Response.Redirect("treelist.aspx?TreeType=" + this.TreeType);
                    base.Response.End();
                }
                SysTree tree = new SysTree();
                SysNode node = tree.GetNode(int.Parse(this.id));
                this.lblID.Text = this.id;
                this.lblOrderid.Text = node.OrderID.ToString();
                this.lblName.Text = node.TreeText;
                if (node.ParentID == 0)
                {
                    this.lblTarget.Text = Site.lblRootDirectory;
                }
                else
                {
                    this.lblTarget.Text = tree.GetNode(node.ParentID).TreeText;
                }
                this.lblUrl.Text = node.Url;
                this.Image1.ImageUrl = node.ImageUrl;
                Permissions permissions = new Permissions();
                if (node.PermissionID == -1)
                {
                    this.lblPermission.Text = SysManage.lblPermissionText;
                }
                else
                {
                    this.lblPermission.Text = permissions.GetPermissionName(node.PermissionID);
                }
                switch (node.TreeType)
                {
                    case 0:
                        this.lblTreeType.Text = SysManage.dropBackendSystem;
                        break;

                    case 1:
                        this.lblTreeType.Text = SysManage.dropBackendEnterprise;
                        break;

                    case 2:
                        this.lblTreeType.Text = SysManage.dropBackendAgent;
                        break;

                    case 3:
                        this.lblTreeType.Text = SysManage.dropBackendUser;
                        break;
                }
                this.lblEnable.Text = node.Enabled ? SysManage.lblEnableTrue : SysManage.lblEnableFalse;
                this.lblDescription.Text = node.Comment;
            }
        }
Exemple #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string text = PageValidate.InputText(this.lblID.Text, 10);
     string s = PageValidate.InputText(this.txtOrderid.Text, 5);
     string str3 = this.txtTreeText.Text;
     string str4 = PageValidate.InputText(this.txtUrl.Text, 100);
     string str5 = this.hideimgurl.Value;
     int num = int.Parse(this.listTarget.SelectedValue);
     string msg = "";
     if (s.Trim() == "")
     {
         msg = msg + SysManage.ErrorIDNotNull + @"\n";
     }
     try
     {
         int.Parse(s);
     }
     catch
     {
         msg = msg + SysManage.ErrorIDFormalError + @"\n";
     }
     if (str3.Trim() == "")
     {
         msg = msg + SysManage.ErrorNameNotNull + @"\n";
     }
     if (msg != "")
     {
         MessageBox.ShowFailTip(this, msg);
     }
     else
     {
         int permissionID = -1;
         if (this.UCDroplistPermission1.PermissionID > 0)
         {
             permissionID = this.UCDroplistPermission1.PermissionID;
         }
         int num3 = -1;
         int num4 = -1;
         string str8 = "false";
         string str9 = PageValidate.InputText(this.txtDescription.Text, 100);
         SysTree tree = new SysTree();
         SysNode node = tree.GetNode(Globals.SafeInt(text, 0));
         node.OrderID = new int?(int.Parse(s));
         node.TreeText = str3;
         node.ParentID = num;
         node.Location = num + "." + s;
         node.Comment = str9;
         node.Url = str4.Replace(@"\", "/");
         node.PermissionID = permissionID;
         node.ImageUrl = str5;
         node.ModuleID = new int?(num3);
         node.KeShiDM = new int?(num4);
         node.KeshiPublic = str8;
         node.TreeType = Globals.SafeInt(this.drpTreeType.SelectedValue, 0);
         node.Enabled = this.chkEnable.Checked;
         tree.UpdateNode(node);
         LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, string.Format("编辑菜单:【{0}】", this.txtTreeText.Text), this);
         base.Response.Redirect(string.Concat(new object[] { "show.aspx?id=", text, "&TreeType=", this.TreeType }));
     }
 }