protected void btnSaveSystemMenu_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemMenuWrapper menuWrapper = SystemMenuWrapper.FindById(int.Parse(this.hidMenuID.Text));

                if (menuWrapper == null)
                {
                    winSystemMenuEdit.Hide();
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }

                menuWrapper.MenuName         = this.txtMenuName.Text.Trim();
                menuWrapper.MenuDescription  = this.txtMenuDescription.Text.Trim();
                menuWrapper.ApplicationID    = SystemApplicationWrapper.FindById(int.Parse(this.hidApplicationID.Text));
                menuWrapper.MenuIsSystemMenu = this.chkMenuIsSystemMenu.Checked;
                menuWrapper.MenuIsEnable     = this.chkMenuIsEnable.Checked;

                if (this.hidPMenuID.Text.Trim() != "")
                {
                    menuWrapper.MenuOrder    = SystemMenuWrapper.GetNewMaxMenuOrder(int.Parse(this.hidPMenuID.Text.Trim()), int.Parse(this.hidApplicationID.Text));
                    menuWrapper.ParentMenuID = SystemMenuWrapper.FindById(int.Parse(this.hidPMenuID.Text.Trim()));
                }
                else
                {
                    menuWrapper.MenuOrder = SystemMenuWrapper.GetNewMaxMenuOrder(0, int.Parse(this.hidApplicationID.Text));
                }

                menuWrapper.MenuIsCategory = this.fsMenuIsCategory.Collapsed;

                if (!menuWrapper.MenuIsCategory)
                {
                    menuWrapper.MenuIconUrl   = this.txtMenuIconUrl.Text.Trim();
                    menuWrapper.MenuUrl       = this.txtMenuUrl.Text.Trim();
                    menuWrapper.MenuType      = this.cmbMenuType.SelectedItem.Value;
                    menuWrapper.MenuUrlTarget = this.cmbMenuUrlTarget.SelectedItem.Value;
                }
                else
                {
                    menuWrapper.MenuIconUrl   = "";
                    menuWrapper.MenuUrl       = "";
                    menuWrapper.MenuType      = "1";
                    menuWrapper.MenuUrlTarget = "1";
                }


                SystemMenuWrapper.Update(menuWrapper);

                winSystemMenuEdit.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        protected void btnSaveSystemMenu_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemMenuWrapper menuWrapper = new SystemMenuWrapper();
                menuWrapper.MenuName         = this.txtMenuName.Text.Trim();
                menuWrapper.MenuDescription  = this.txtMenuDescription.Text.Trim();
                menuWrapper.ApplicationID    = SystemApplicationWrapper.FindById(int.Parse(this.hidApplicationID.Text));
                menuWrapper.MenuIsSystemMenu = this.chkMenuIsSystemMenu.Checked;
                menuWrapper.MenuIsEnable     = this.chkMenuIsEnable.Checked;
                menuWrapper.MenuIconUrl      = this.txtMenuIconUrl.Text.Trim();

                if (this.hidPMenuID.Text.Trim() != "")
                {
                    menuWrapper.MenuOrder    = SystemMenuWrapper.GetNewMaxMenuOrder(int.Parse(this.hidPMenuID.Text.Trim()), int.Parse(this.hidApplicationID.Text));
                    menuWrapper.ParentMenuID = SystemMenuWrapper.FindById(int.Parse(this.hidPMenuID.Text.Trim()));
                }
                else
                {
                    menuWrapper.MenuOrder = SystemMenuWrapper.GetNewMaxMenuOrder(0, int.Parse(this.hidApplicationID.Text));
                }

                menuWrapper.MenuIsCategory = this.fsMenuIsCategory.Collapsed;

                if (!menuWrapper.MenuIsCategory)
                {
                    menuWrapper.MenuUrl       = this.txtMenuUrl.Text.Trim();
                    menuWrapper.MenuType      = this.cmbMenuType.SelectedItem.Value;
                    menuWrapper.MenuUrlTarget = this.cmbMenuUrlTarget.SelectedItem.Value;
                }
                else
                {
                    menuWrapper.MenuUrl       = "";
                    menuWrapper.MenuType      = "1";
                    menuWrapper.MenuUrlTarget = "1";
                }


                SystemMenuWrapper.Save(menuWrapper);

                winSystemMenuAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), ex.Message);
            }
        }