Beispiel #1
0
        public void Insert(LanguageWord languageObject, string language)
        {
            try
            {
                CheckLanguage(language);

                if (_domainDataProvider.CustomSearch(typeof(LanguageWord), new string[] { "ControlID" }, new object[] { languageObject.ControlID }) != null)
                {
                    if (language.IndexOf(LanguageType.English) != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlENText" }, new object[] { languageObject.ControlENText });
                    }

                    if (language.IndexOf(LanguageType.SimplifiedChinese) != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlCHSText" }, new object[] { languageObject.ControlCHSText });
                    }

                    if (language.IndexOf(LanguageType.TraditionalChinese) != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlCHTText" }, new object[] { languageObject.ControlCHTText });
                    }
                }
                else
                {
                    _domainDataProvider.Insert(languageObject);
                }
            }
            catch (Exception ex)
            {
                //throw new Exception(languageObject.ControlID + ":" + languageObject.ControlCHSText + ":" + ex.Message, ex);
                ExceptionManager.Raise(this.GetType(), "$Error_Language_Object", string.Format("[$ControlCHSText={0}]", languageObject.ControlCHSText), ex);
            }
        }
Beispiel #2
0
        public void Insert(LanguageWord languageObject, string language)
        {
            try
            {
                CheckLanguage(language);

                if (_domainDataProvider.CustomSearch(typeof(LanguageWord), new string[] { "ControlID" }, new object[] { languageObject.ControlID }) != null)
                {
                    if (language.IndexOf("ENU") != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlENText" }, new object[] { languageObject.ControlENText });
                    }

                    if (language.IndexOf("CHS") != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlCHSText" }, new object[] { languageObject.ControlCHSText });
                    }

                    if (language.IndexOf("CHT") != -1)
                    {
                        _domainDataProvider.CustomUpdate(languageObject, new string[] { "ControlCHTText" }, new object[] { languageObject.ControlCHTText });
                    }
                }
                else
                {
                    _domainDataProvider.Insert(languageObject);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(languageObject.ControlID + ":" + languageObject.ControlCHSText + ":" + ex.Message, ex);
            }
        }