Ejemplo n.º 1
0
 /// <summary>
 /// Translate to BPartner Language
 /// </summary>
 private void Translate()
 {
     if (_bpartner != null && _bpartner.GetAD_Language() != null)
     {
         String       key = _bpartner.GetAD_Language() + Get_ID();
         MMailTextTrl trl = cacheTrl[key];
         if (trl == null)
         {
             trl = GetTranslation(_bpartner.GetAD_Language());
             if (trl != null)
             {
                 cacheTrl.Add(key, trl);
             }
         }
         if (trl != null)
         {
             _mailHeader = trl.mailHeader;
             _mailText   = trl.mailText;
             _mailText2  = trl.mailText2;
             _mailText3  = trl.mailText3;
         }
     }
     //	No Translation
     _mailHeader = base.GetMailHeader();
     _mailText   = base.GetMailText();
     _mailText2  = base.GetMailText2();
     _mailText3  = base.GetMailText3();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Translate to BPartner Language
        /// </summary>
        private void Translate()
        {
            string language = "";

            if (_bpartner != null && _bpartner.GetAD_Language() != null)
            {
                language = _bpartner.GetAD_Language();
            }
            else if (!Env.IsBaseLanguage(GetCtx().GetAD_Language(), ""))
            {
                language = GetCtx().GetAD_Language();
            }

            if (!string.IsNullOrEmpty(language) && language.Length > 0)
            {
                String       key = language + Get_ID();
                MMailTextTrl trl = cacheTrl[key];
                if (trl == null)
                {
                    trl = GetTranslation(language);
                    if (trl != null)
                    {
                        cacheTrl.Add(key, trl);
                    }
                }
                if (trl != null)
                {
                    _mailHeader = trl.mailHeader;
                    _mailText   = trl.mailText;
                    _mailText2  = trl.mailText2;
                    _mailText3  = trl.mailText3;
                    return;
                }
            }

            //	No Translation
            _mailHeader = base.GetMailHeader();
            _mailText   = base.GetMailText();
            _mailText2  = base.GetMailText2();
            _mailText3  = base.GetMailText3();
        }