Example #1
0
 public frmTranslateMessage(string languageCode, string code)
 {
     InitializeComponent();
     setTranslateMessage();
     txtLanguageCode.Text = languageCode;
     message = Session.Entities.GetMessage(code, languageCode);
 }
Example #2
0
 public frmTranslateMessage(string languageCode = "")
 {
     InitializeComponent();
     setTranslateMessage();
     message = new TranslateMessage();
     message.LanguageCode = languageCode;
 }
Example #3
0
        public TranslateMessage PostMessage(TranslateMessage message)
        {
            var item = TranslateMessages.FirstOrDefault(c => c.Code == message.Code && c.LanguageCode == message.LanguageCode);

            if (item != null)
            {
                item = message;
                return(item);
            }
            else
            {
                if (Session.Entities.GetTranslateMessages().Any(c => c.Code == message.Code && c.LanguageCode == message.LanguageCode))
                {
                    throw new Exception(Translate.GetMessage("dublicate-message"));
                }
                TranslateMessages.Add(message);
                return(message);
            }
        }