Example #1
0
 public List<PersonInternship> GetAll()
 {
     PersonInternshipDAC _personInternshipComponent = new PersonInternshipDAC();
      IDataReader reader =  _personInternshipComponent.GetAllPersonInternship().CreateDataReader();
      List<PersonInternship> _personInternshipList = new List<PersonInternship>();
      while(reader.Read())
      {
      if(_personInternshipList == null)
          _personInternshipList = new List<PersonInternship>();
          PersonInternship _personInternship = new PersonInternship();
          if(reader["PersonInternshipId"] != DBNull.Value)
              _personInternship.PersonInternshipId = Convert.ToInt32(reader["PersonInternshipId"]);
          if(reader["PersonId"] != DBNull.Value)
              _personInternship.PersonId = Convert.ToInt32(reader["PersonId"]);
          if(reader["Service"] != DBNull.Value)
              _personInternship.Service = Convert.ToString(reader["Service"]);
          if(reader["Institution"] != DBNull.Value)
              _personInternship.Institution = Convert.ToString(reader["Institution"]);
          if(reader["Evaluation"] != DBNull.Value)
              _personInternship.Evaluation = Convert.ToString(reader["Evaluation"]);
          if(reader["StartDate"] != DBNull.Value)
              _personInternship.StartDate = Convert.ToDateTime(reader["StartDate"]);
          if(reader["EndDate"] != DBNull.Value)
              _personInternship.EndDate = Convert.ToDateTime(reader["EndDate"]);
      _personInternship.NewRecord = false;
      _personInternshipList.Add(_personInternship);
      }             reader.Close();
      return _personInternshipList;
 }