Esempio n. 1
0
        public void Show(int id)
        {
            try
            {
                SystemApplicationWrapper systemApplication = SystemApplicationWrapper.FindById(id);

                if (systemApplication != null)
                {
                    txtSystemApplicationName.Text                   = systemApplication.SystemApplicationName;
                    txtSystemApplicationDescription.Text            = systemApplication.SystemApplicationDescription;
                    txtSystemApplicationUrl.Text                    = systemApplication.SystemApplicationUrl;
                    chkSystemApplicationIsSystemApplication.Checked = (systemApplication.SystemApplicationIsSystemApplication.HasValue) ? systemApplication.SystemApplicationIsSystemApplication.Value : false;

                    hidSystemApplicationID.Text = id.ToString();


                    winSystemApplicationEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        public void Show(string applicationId, string parentID)
        {
            SystemApplicationWrapper application = SystemApplicationWrapper.FindById(int.Parse(applicationId));

            if (application != null)
            {
                this.hidApplicationID.Text   = application.SystemApplicationID.ToString();
                this.lblApplicationName.Text = application.SystemApplicationName;


                if (parentID == "")
                {
                    this.lblParentMenuName.Text          = "作为主菜单";
                    this.fsMenuIsCategory.Disabled       = true;
                    this.fsMenuIsCategory.CheckboxToggle = false;
                }
                else
                {
                    this.lblParentMenuName.Text =
                        SystemMenuWrapper.FindById(int.Parse(parentID)).MenuName;
                    this.hidPMenuID.Text                 = parentID;
                    this.fsMenuIsCategory.Disabled       = false;
                    this.fsMenuIsCategory.CheckboxToggle = true;
                }

                this.txtMenuName.Text        = "";
                this.txtMenuDescription.Text = "";
            }

            this.winSystemMenuAdd.Show();
        }
        public void Show(int id)
        {
            try
            {
                SystemApplicationWrapper systemApplication = SystemApplicationWrapper.FindById(id);

                if (systemApplication != null)
                {
                    txtSystemApplicationName.Text                   = systemApplication.SystemApplicationName;
                    txtSystemApplicationDescription.Text            = systemApplication.SystemApplicationDescription;
                    txtSystemApplicationUrl.Text                    = systemApplication.SystemApplicationUrl;
                    chkSystemApplicationIsSystemApplication.Checked = (systemApplication.SystemApplicationIsSystemApplication.HasValue) ? systemApplication.SystemApplicationIsSystemApplication.Value : false;

                    hidSystemApplicationID.Text = id.ToString();


                    winSystemApplicationEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "Error Message:The data is not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), ex.Message);
                return;
            }
        }
        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 = "Error Message:Record not existed.";
                    return;
                }

                menuWrapper.MenuName         = this.txtMenuName.Text.Trim();
                menuWrapper.MenuCode         = this.txtMenuCode.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.Update(menuWrapper);

                winSystemMenuEdit.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), 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;

                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.Save(menuWrapper);

                winSystemMenuAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Esempio n. 6
0
        public string GetTreeNodes(string selectNodeID)
        {
            int applicationid = int.Parse(selectNodeID);

            SystemApplicationWrapper applicationWrapper = SystemApplicationWrapper.FindById(applicationid);

            if (applicationWrapper != null)
            {
                List <NavMenu> menus = SystemMenuWrapper.GetNavMenuByApplication(applicationWrapper);

                return(BuildTree(menus, applicationWrapper.SystemApplicationName).ToJson());
            }

            return("");
        }
Esempio n. 7
0
        protected void btnSaveSystemApplication_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemApplicationWrapper systemApplication = SystemApplicationWrapper.FindById(int.Parse(hidSystemApplicationID.Text.Trim()));
                systemApplication.SystemApplicationName                = txtSystemApplicationName.Text.Trim();
                systemApplication.SystemApplicationDescription         = txtSystemApplicationDescription.Text.Trim();
                systemApplication.SystemApplicationUrl                 = txtSystemApplicationUrl.Text.Trim();
                systemApplication.SystemApplicationIsSystemApplication = chkSystemApplicationIsSystemApplication.Checked;
                SystemApplicationWrapper.Update(systemApplication);

                winSystemApplicationEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSystemApplication_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemApplicationWrapper systemApplication = SystemApplicationWrapper.FindById(int.Parse(hidSystemApplicationID.Text.Trim()));
                systemApplication.SystemApplicationName                = txtSystemApplicationName.Text.Trim();
                systemApplication.SystemApplicationDescription         = txtSystemApplicationDescription.Text.Trim();
                systemApplication.SystemApplicationUrl                 = txtSystemApplicationUrl.Text.Trim();
                systemApplication.SystemApplicationIsSystemApplication = chkSystemApplicationIsSystemApplication.Checked;
                SystemApplicationWrapper.Update(systemApplication);

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