예제 #1
0
    public string GetMessageString(string messageId)
    {
        string     messageString = "";
        AppMessage message       = GetMessage(messageId);

        if (message != null)
        {
            messageString = message.GetMessage(language);
        }
        return(messageString);
    }
예제 #2
0
        public virtual void Form_Load(object sender, EventArgs e)
        {
            if (!this.DesignMode)
            {
                // 设置鼠标繁忙状态,并保留原先的状态
                Cursor holdCursor = this.Cursor;
                this.Cursor     = Cursors.WaitCursor;
                this.FormLoaded = false;
                try
                {
                    if (!this.DesignMode)
                    {
                        // 是否记录访问日志
                        if (BaseSystemInfo.RecordLog)
                        {
                            // 已经登录了系统了,才记录日志
                            if (BaseSystemInfo.UserIsLogOn)
                            {
                                // 调用服务事件
                                if (this.RecordFormLog)
                                {
                                    // 调用服务事件
                                    // this.LogId = DotNetService.Instance.LogService.WriteLog(UserInfo, this.Name, this.Text, "FormLoad");
                                    DotNetService dotNetService = new DotNetService();
                                    dotNetService.LogService.WriteLog(UserInfo, this.Name, AppMessage.GetMessage(this.Name), "FormLoad", AppMessage.LoadWindow);
                                    if (dotNetService.LogService is ICommunicationObject)
                                    {
                                        ((ICommunicationObject)dotNetService.LogService).Close();
                                    }
                                }
                            }
                        }
                    }

                    // 必须放在初始化组件之前
                    this.GetIcon();
                    // 获得页面的权限
                    this.GetPermission();
                    // 加载窗体
                    this.FormOnLoad();
                    // 设置按钮状态
                    this.SetControlState();
                    if (BaseSystemInfo.MultiLanguage)
                    {
                        // 多语言国际化加载
                        if (ResourceManagerWrapper.Instance.GetLanguages() != null)
                        {
                            this.Localization(this);
                        }
                    }
                    if (this.LoadUserParameters)
                    {
                        // 客户端页面配置加载
                        this.LoadUserParameter(this);
                    }
                    // 设置帮助
                    this.SetHelp();
                }
                catch (Exception ex)
                {
                    this.ProcessException(ex);
                }
                finally
                {
                    this.FormLoaded = true;
                    // 设置鼠标默认状态,原来的光标状态
                    this.Cursor = holdCursor;
                }
            }
        }
        public virtual void Control_Load(object sender, EventArgs e)
        {
            if (!this.DesignMode)
            {
                if (this.Parent == null && this.Parent == null)
                {
                    LoadingUtil.ShowWaitLoading();
                }

                // 设置鼠标繁忙状态,并保留原先的状态
                System.Windows.Forms.Cursor holdCursor = this.Cursor;
                this.Cursor        = Cursors.WaitCursor;
                this.ControlLoaded = false;
                try
                {
                    // 是否记录访问日志
                    if (BaseSystemInfo.RecordLog)
                    {
                        // 已经登录了系统了,才记录日志
                        if (BaseSystemInfo.UserIsLogOn)
                        {
                            // 调用服务事件
                            if (this.RecordControlLog)
                            {
                                // 调用服务事件
                                // this.LogId = dotNetService.LogService.WriteLog(UserInfo, this.ItemName, this.Text, "FormLoad");
                                DotNetService dotNetService = new DotNetService();
                                dotNetService.LogService.WriteLog(UserInfo, this.Name, AppMessage.GetMessage(this.Name), "FormLoad", AppMessage.LoadWindow);
                                if (dotNetService.LogService is ICommunicationObject)
                                {
                                    ((ICommunicationObject)dotNetService.LogService).Close();
                                }
                            }
                        }
                    }

                    // 获得页面的权限
                    this.GetPermissions();
                    // 加载窗体
                    this.ControlOnLoad();
                    // 设置按钮状态
                    this.SetControlState();
                    if (BaseSystemInfo.MultiLanguage)
                    {
                        // 多语言国际化加载

                        /*
                         * if (ResourceManagerWrapper.Instance.GetLanguages() != null)
                         * {
                         *  this.Localization(this);
                         * }
                         */
                    }
                    if (this.LoadUserParameters)
                    {
                        // 客户端页面配置加载
                        this.LoadUserParameter(this);
                    }
                    // 设置帮助
                    this.SetHelp();
                }
                catch (Exception catchException)
                {
                    catchException.ProcessException();
                }
                finally
                {
                    this.ControlLoaded = true;
                    // 设置鼠标默认状态,原来的光标状态
                    this.Cursor = holdCursor;
                }

                if (this.Parent == null)
                {
                    //LoadingUtil.StopLoading();
                }
                this.Visible = true;
            }
        }