Esempio n. 1
0
 public Language GetByID(int _languageId)
 {
     LanguageDAC _languageComponent = new LanguageDAC();
      IDataReader reader = _languageComponent.GetByIDLanguage(_languageId);
      Language _language = null;
      while(reader.Read())
      {
          _language = new Language();
          if(reader["LanguageId"] != DBNull.Value)
              _language.LanguageId = Convert.ToInt32(reader["LanguageId"]);
          if(reader["LanguageCode"] != DBNull.Value)
              _language.LanguageCode = Convert.ToString(reader["LanguageCode"]);
          if(reader["Name"] != DBNull.Value)
              _language.Name = Convert.ToString(reader["Name"]);
      _language.NewRecord = false;             }             reader.Close();
      return _language;
 }
Esempio n. 2
0
 public List<Language> GetAll()
 {
     LanguageDAC _languageComponent = new LanguageDAC();
      IDataReader reader =  _languageComponent.GetAllLanguage().CreateDataReader();
      List<Language> _languageList = new List<Language>();
      while(reader.Read())
      {
      if(_languageList == null)
          _languageList = new List<Language>();
          Language _language = new Language();
          if(reader["LanguageId"] != DBNull.Value)
              _language.LanguageId = Convert.ToInt32(reader["LanguageId"]);
          if(reader["LanguageCode"] != DBNull.Value)
              _language.LanguageCode = Convert.ToString(reader["LanguageCode"]);
          if(reader["Name"] != DBNull.Value)
              _language.Name = Convert.ToString(reader["Name"]);
      _language.NewRecord = false;
      _languageList.Add(_language);
      }             reader.Close();
      return _languageList;
 }
Esempio n. 3
0
 public bool Insert(Language language)
 {
     int autonumber = 0;
     LanguageDAC languageComponent = new LanguageDAC();
     bool endedSuccessfuly = languageComponent.InsertNewLanguage( ref autonumber,  language.LanguageCode,  language.Name);
     if(endedSuccessfuly)
     {
         language.LanguageId = autonumber;
     }
     return endedSuccessfuly;
 }
Esempio n. 4
0
 public void Delete(int Original_LanguageId)
 {
     LanguageDAC languageComponent = new LanguageDAC();
     languageComponent.DeleteLanguage(Original_LanguageId);
 }
Esempio n. 5
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     LanguageDAC languagecomponent = new LanguageDAC();
     return languagecomponent.UpdateDataset(dataset);
 }
Esempio n. 6
0
 public bool Update( string LanguageCode,  string Name,  int Original_LanguageId)
 {
     LanguageDAC languageComponent = new LanguageDAC();
     return languageComponent.UpdateLanguage( LanguageCode,  Name,  Original_LanguageId);
 }
Esempio n. 7
0
 public bool Update(Language language ,int old_languageId)
 {
     LanguageDAC languageComponent = new LanguageDAC();
     return languageComponent.UpdateLanguage( language.LanguageCode,  language.Name,  old_languageId);
 }
Esempio n. 8
0
        public bool Insert( string LanguageCode,  string Name)
        {
            LanguageDAC languageComponent = new LanguageDAC();
            int LanguageId = 0;

            return languageComponent.InsertNewLanguage( ref LanguageId,  LanguageCode,  Name);
        }