Пример #1
0
 public int UpdateLanguageByID(string languageName, int languageID)
 {
     try
     {
         int rowsAffected = languageTableAdapter.UpdateLanguage(languageName, languageID);
         return(rowsAffected);
     }
     catch (Exception)
     {
         return(0);
     }
 }
        public int UpdateLanguage(string languageName, int languageID)
        {
            var languageTable   = new UserData.TabLanguageDataTable();
            var languageAdapter = new TabLanguageTableAdapter();
            int rowCount        = 0;

            if (languageID != 0)
            {
                rowCount = languageAdapter.UpdateLanguage(languageName, languageID);
                return(rowCount);
            }
            return(rowCount);
        }
 // update a language row
 public bool IsLanguageUpdated(LanguageDTO updatedLanguage)
 {
     try
     {
         // update row using query
         tabLanguageTableAdapter.UpdateLanguage(updatedLanguage.LanguageName, updatedLanguage.LID);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Пример #4
0
 /// <summary>
 /// Update register from TabLanguage.
 /// </summary>
 /// <param name="languageName">string languageName</param>
 /// <param name="languageID">int languageID</param>
 /// <returns>int rowsAffected</returns>
 /// <exception cref="ex">Exception</exception>
 public int UpdateLanguage(string languageName, int languageID)
 {
     try
     {
         return((int)_tabLanguageTableAdapter.UpdateLanguage(languageName, languageID));
     }
     catch (Exception ex)
     {
         //Error log simulate
         Console.WriteLine(ex.ToString());
         Console.WriteLine(ex.GetBaseException().ToString());
         throw;
     }
 }