Beispiel #1
0
        /// <summary>
        /// Set language for Title, Path, Grid
        /// </summary>
        public virtual void SetLanguage()
        {
            string fuctionGrp = this.FunctionGr;

            this.btnSaveAndNext.Caption = LanguageUltility.GetString(this.ViewMode == CommonData.Mode.View ? CommonData.ButtonCaption.Next : CommonData.ButtonCaption.SaveAndNext);
            this.btnClear.Caption       = LanguageUltility.GetString(this.ViewMode == CommonData.Mode.View ? CommonData.ButtonCaption.Edit : (this.ViewMode == CommonData.Mode.Edit ? CommonData.ButtonCaption.Reset : CommonData.ButtonCaption.Clear));
            //set language for Path

            /*
             *  SYS_User_Edit_New_Path
             *  {0}_{1}_Path
             *  {0} = SYS_User_Edit = this.FunctionGr
             *  {1} = New = this.ViewMode.ToString()
             * */
            this.lblPath.Caption = LanguageUltility.GetString(string.Format("{0}_{1}_Path", fuctionGrp, this.ViewMode.ToString()), "Danh mục > Danh mục cơ cấu tổ chức  > Văn phòng");
            //set language for Title

            /*
             *  SYS_User_Edit_Edit_Form
             *  {0}_{1}_Path
             *  {0} = SYS_User_Edit = this.FunctionGr
             *  {1} = New = this.ViewMode.ToString()
             * */
            this.Text = LanguageUltility.GetString(string.Format("{0}_{1}_Form", fuctionGrp, this.ViewMode.ToString()), "Master Edit Form");

            if (this.MessageBox != null)
            {
                this.lblErrorMessage.Text = this.MessageBox.DisplayMessage;
            }
        }
Beispiel #2
0
 public virtual void InitLanguage(string lang, bool isSetCulture = true)
 {
     //LanguageUltility.ChangeLanguage("Ivs.Core.Properties.COM_MSG_{0}", Assembly.GetAssembly(typeof(LanguageUltility)), this, UserSession.LangId);
     LanguageUltility.ChangeLanguage(baseName, Assembly.GetAssembly(typeof(LanguageUltility)), this, LstControls, lang ?? UserSession.LangId, isSetCulture);
     this.Text = LanguageUltility.GetString(this.Name, "Message");
     //this.Invalidate();
 }
Beispiel #3
0
        /// <summary>
        /// Set language for Title, Path, Grid
        /// </summary>
        public virtual void SetLanguage()
        {
            //set language for Path

            /*
             *  MS_Factories_Search_Path
             *  {0}_Search_Path : {0} = this.FunctionGr = MS_Factories
             * */
            this.lblPath.Caption = LanguageUltility.GetString(string.Format("{0}_Search_Path", this.FunctionGr), "Danh mục > Danh mục cơ cấu tổ chức  > Văn phòng");
            //set language for Title

            /*
             *  MS_Factories_Search_Form
             *  {0}_Search_Form : {0} = this.FunctionGr = MS_Factories
             * */
            this.Text = LanguageUltility.GetString(string.Format("{0}_Search_Form", this.FunctionGr), "Master Search Form");

            this.ChangeLanguageForGrid(this.displayGrid);

            //this.lblErrorMessage.Text = "";
            if (this.MessageBox != null)
            {
                this.lblErrorMessage.Text = this.MessageBox.DisplayMessage;
            }
        }
Beispiel #4
0
        /// <summary>
        /// Override setlanguge method
        /// </summary>
        public override void SetLanguage()
        {
            base.SetLanguage();

            this.lblPath.Caption = string.Format(LanguageUltility.GetString(string.Format("{0}_{1}_Path", this.FunctionGr, this.ViewMode.ToString()), "Danh mục > Danh mục cơ cấu tổ chức  > Văn phòng")
                                                 , ((ST_StockTransactionMasterDto)this.CurrentDto).WarehouseName);
            this.Text = string.Format(LanguageUltility.GetString(string.Format("{0}_{1}_Form", this.FunctionGr, this.ViewMode.ToString()), "Master Edit Form")
                                      , ((ST_StockTransactionMasterDto)this.CurrentDto).WarehouseName);
        }
Beispiel #5
0
 /// <summary>
 /// Change language for gridview
 /// </summary>
 /// <param name="grid"></param>
 protected virtual void ChangeLanguageForGrid(IvsGridControl grid)
 {
     if (grid != null)
     {
         grid.EmbeddedNavigator.TextStringFormat = LanguageUltility.GetString(CommonConstantMessage.COM_MSG_GRID_RECORD_OF_TOTAL, "Mẫu tin {0} của {1}");
         if (grid.MainView != null)
         {
             ((IvsGridView)grid.MainView).GroupPanelText = LanguageUltility.GetString(CommonConstantMessage.COM_MSG_HEADERGRID_DRAG, "Kéo một tiêu đề cột lên đây để nhóm cột đó");
         }
     }
 }
Beispiel #6
0
        //public IvsMessage(string messageId, string messageIcon, params object[] parameters)
        //    : this(messageId, parameters)
        //{
        //    //this._messageIcon = messageIcon;
        //}

        //end

        //public IvsMessage(string messageId)
        //{
        //    //create I18n class object
        //    I18n i18n = new I18n();

        //    _messageId = messageId;
        //    _messageText = i18n.GetMessage(messageId);
        //}

        //public IvsMessage(string messageId, int para)
        //{
        //    //create I18n class object
        //    I18n i18n = new I18n();

        //    _messageId = messageId;
        //    _parameter = para;
        //    _messageText = i18n.GetMessage(messageId);

        //    // replace ky tu $ trong _messageText bang para
        //    if (para >= 0)
        //        _messageText = _messageText.Replace("$", para.ToString());
        //}

        //public IvsMessage(string messageId, string para)
        //{
        //    //create I18n class object
        //    I18n i18n = new I18n();

        //    _messageId = messageId;
        //    _parameterS = para;
        //    _messageText = i18n.GetMessage(messageId);

        //    // replace ky tu $ trong _messageText bang para
        //    if (!string.IsNullOrEmpty(para))
        //        _messageText = _messageText.Replace("$", para);
        //}

        //public IvsMessage(string messageId, string[] para)
        //{
        //    //create I18n class object
        //    I18n i18n = new I18n();

        //    _messageId = messageId;

        //    _parameterString = para;

        //    _messageText = i18n.GetMessage(messageId);

        //    if (!string.IsNullOrEmpty(_messageText))
        //    {
        //        string[] messTmp = _messageText.Split('$');
        //        _messageText = CommonData.StringEmpty;
        //        for (int i = 0; i < messTmp.Length; i++)
        //        {
        //            try
        //            {
        //                _messageText += messTmp[i] + " " + para[i];
        //            }
        //            catch
        //            {
        //                _messageText += messTmp[i];
        //            }
        //        }
        //    }
        //}

        public void ChangeLanguage(string langId)
        {
            string message = LanguageUltility.GetString(_messageId);

            if (_parameterString != null && _parameterString.Length > 0 && !string.IsNullOrEmpty(message))
            {
                message = string.Format(message, _parameterString);
            }
            this.SplitMessage(message, ref _messageText, ref _messageIcon);
            //_messageText = message;

            //create I18n class object
            //I18n i18n = new I18n();
            //_messageText = i18n.GetMessage(MessageId, langId);

            //// replace ky tu $ trong _messageText bang _parameter
            //if (_parameter >= 0)
            //    _messageText = _messageText.Replace("$", _parameter.ToString());
            //if (!string.IsNullOrEmpty(_parameterS))
            //    _messageText = _messageText.Replace("$", _parameterS.ToString());
            //else if (_parameterString != null && _parameterString.Length == 1)
            //{
            //    _messageText = _messageText.Replace("$", _parameterString[0]);
            //}
            //else if (_parameterString != null && _parameterString.Length > 1)
            //{
            //    string[] messTmp = _messageText.Split('$');
            //    _messageText = CommonData.StringEmpty;
            //    for (int i = 0; i < messTmp.Length; i++)
            //    {
            //        try
            //        {
            //            _messageText += messTmp[i] + "" + _parameterString[i];
            //        }
            //        catch
            //        {
            //            _messageText += messTmp[i];
            //        }
            //    }
            //}
        }
Beispiel #7
0
        /// <summary>
        /// Change language message dialog
        /// </summary>
        public void ChangeMessage()
        {
            DataTable tb = new DataTable();

            tb.Columns.Add("MessageText", Type.GetType("System.String"));
            foreach (IvsMessage ms in _list)
            {
                DataRow dr = tb.NewRow();
                if (ms.ParameterString == null || ms.ParameterString.Length == 0)
                {
                    string message = LanguageUltility.GetString(ms.MessageId);
                    dr["MessageText"] = message;
                }
                else
                {
                    string message = LanguageUltility.GetString(ms.MessageId);
                    dr["MessageText"] = !string.IsNullOrEmpty(message) ? string.Format(message, ms.ParameterString) : string.Empty;
                }

                tb.Rows.Add(dr);
            }
            dgcMain.DataSource = tb;
        }
Beispiel #8
0
        /// <summary>
        /// Set Language for screen
        /// </summary>
        public virtual void SetLanguage()
        {
            /*
             *  SYS_User_Edit_New_Path
             *  {0}_{1}_Path
             *  {0} = SYS_User_Edit = this.FunctionGr
             *  {1} = New = this.ViewMode.ToString()
             * */
            this.lblPath.Caption = LanguageUltility.GetString(string.Format("{0}_{1}_Path", this.FunctionGr, "Search"), "Danh mục > Danh mục cơ cấu tổ chức  > Văn phòng");
            //set language for Title

            /*
             *  SYS_User_Edit_Edit_Form
             *  {0}_{1}_Path
             *  {0} = SYS_User_Edit = this.FunctionGr
             *  {1} = New = this.ViewMode.ToString()
             * */
            this.Text = LanguageUltility.GetString(string.Format("{0}_{1}_Form", this.FunctionGr, "Search"), "Master Report Form");

            if (this.MessageBox != null)
            {
                this.lblErrorMessage.Text = this.MessageBox.DisplayMessage;
            }
        }