public frmTranslateMessage(string languageCode, string code) { InitializeComponent(); setTranslateMessage(); txtLanguageCode.Text = languageCode; message = Session.Entities.GetMessage(code, languageCode); }
public frmTranslateMessage(string languageCode = "") { InitializeComponent(); setTranslateMessage(); message = new TranslateMessage(); message.LanguageCode = languageCode; }
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); } }