Exemple #1
0
 protected void btnSave_ServerClick(object sender, EventArgs e)
 {
     try
     {
         int        menuID     = CurrentSelectMenuID;
         SystemMenu systemMenu = systemMenuServiceInstance.FindById(menuID);
         if (systemMenu != null)
         {
             systemMenu.MenuName        = this.txtMenuName.Text.Trim();
             systemMenu.MenuDescription = this.txtMenuDescription.Value.Trim();
             systemMenu.MenuUrl         = this.txtMenuUrl.Text.Trim();
             systemMenuServiceInstance.Update(systemMenu);
             if (systemMenu.ParentMenuID == null)
             {
                 BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, "0");
             }
             else
             {
                 BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, menuID.ToString());
             }
             this.lblMessage.Text = "更新菜单成功!";
         }
         else
         {
             BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, "0");
         }
     }
     catch (Exception ex)
     {
         this.lblMessage.Text  = "系统错误:" + ex.Message;
         this.btnSave.Disabled = true;
     }
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack)
            {
                return;
            }

            try
            {
                int parentMenuID = -1;
                int.TryParse(this.Request.QueryString["pid"], out parentMenuID);

                int applicationID = -1;
                int.TryParse(this.Request.QueryString["appid"], out applicationID);

                SystemApplication application = systemApplicationServiceInstance.FindById(applicationID);

                if (parentMenuID == 0)
                {
                    this.lblParentMenuName.Text = application.SystemApplicationName;
                    this.txtMenuUrl.ReadOnly    = true;
                    return;
                }
                else if (parentMenuID > 0)
                {
                    SystemMenu parentMenu = systemMenuServiceInstance.FindById(parentMenuID);
                    this.lblParentMenuName.Text = parentMenu.MenuName;
                    return;
                }
                else
                {
                    this.lblParentMenuName.Text = "参数错误:无法添加子菜单!";
                    this.btnSave.Enabled        = false;
                    return;
                }
            }
            catch (Exception ex)
            {
                this.lblParentMenuName.Text = "系统错误:" + ex.Message;
                this.btnSave.Enabled        = false;
                return;
            }
        }
Exemple #3
0
 protected override SystemMenu LoadDataByID(int id)
 {
     return(systemMenuServiceInstance.FindById(id));
 }