public List<VisaRequest> GetAll() { VisaRequestDAC _visaRequestComponent = new VisaRequestDAC(); IDataReader reader = _visaRequestComponent.GetAllVisaRequest().CreateDataReader(); List<VisaRequest> _visaRequestList = new List<VisaRequest>(); while(reader.Read()) { if(_visaRequestList == null) _visaRequestList = new List<VisaRequest>(); VisaRequest _visaRequest = new VisaRequest(); if(reader["VisaRequestID"] != DBNull.Value) _visaRequest.VisaRequestID = Convert.ToInt32(reader["VisaRequestID"]); if(reader["ConferenceID"] != DBNull.Value) _visaRequest.ConferenceID = Convert.ToInt32(reader["ConferenceID"]); if(reader["PersonID"] != DBNull.Value) _visaRequest.PersonID = Convert.ToInt32(reader["PersonID"]); if(reader["Country"] != DBNull.Value) _visaRequest.Country = Convert.ToString(reader["Country"]); if(reader["City"] != DBNull.Value) _visaRequest.City = Convert.ToString(reader["City"]); if(reader["Religion"] != DBNull.Value) _visaRequest.Religion = Convert.ToString(reader["Religion"]); if(reader["JobTitle"] != DBNull.Value) _visaRequest.JobTitle = Convert.ToString(reader["JobTitle"]); if(reader["Company"] != DBNull.Value) _visaRequest.Company = Convert.ToString(reader["Company"]); if(reader["PassportAttachment"] != DBNull.Value) _visaRequest.PassportAttachment = Convert.ToString(reader["PassportAttachment"]); if(reader["IsOrganizationApproved"] != DBNull.Value) _visaRequest.IsOrganizationApproved = Convert.ToBoolean(reader["IsOrganizationApproved"]); if(reader["IsTaken"] != DBNull.Value) _visaRequest.IsTaken = Convert.ToBoolean(reader["IsTaken"]); if(reader["VisaAttachment"] != DBNull.Value) _visaRequest.VisaAttachment = Convert.ToString(reader["VisaAttachment"]); _visaRequest.NewRecord = false; _visaRequestList.Add(_visaRequest); } reader.Close(); return _visaRequestList; }
public VisaRequest GetAllByConferenceIdPersonId(int ConferenceID,int PersonID) { VisaRequestDAC _visaRequestComponent = new VisaRequestDAC(); IDataReader reader = _visaRequestComponent.GetAllVisaRequest(string.Format("ConferenceID = {0} and PersonID = {1}",ConferenceID,PersonID)).CreateDataReader(); VisaRequest _visaRequest = new VisaRequest(); while (reader.Read()) { if (reader["VisaRequestID"] != DBNull.Value) _visaRequest.VisaRequestID = Convert.ToInt32(reader["VisaRequestID"]); if (reader["ConferenceID"] != DBNull.Value) _visaRequest.ConferenceID = Convert.ToInt32(reader["ConferenceID"]); if (reader["PersonID"] != DBNull.Value) _visaRequest.PersonID = Convert.ToInt32(reader["PersonID"]); if (reader["Country"] != DBNull.Value) _visaRequest.Country = Convert.ToString(reader["Country"]); if (reader["City"] != DBNull.Value) _visaRequest.City = Convert.ToString(reader["City"]); if (reader["Religion"] != DBNull.Value) _visaRequest.Religion = Convert.ToString(reader["Religion"]); if (reader["JobTitle"] != DBNull.Value) _visaRequest.JobTitle = Convert.ToString(reader["JobTitle"]); if (reader["Company"] != DBNull.Value) _visaRequest.Company = Convert.ToString(reader["Company"]); if (reader["PassportAttachment"] != DBNull.Value) _visaRequest.PassportAttachment = Convert.ToString(reader["PassportAttachment"]); if (reader["IsOrganizationApproved"] != DBNull.Value) _visaRequest.IsOrganizationApproved = Convert.ToBoolean(reader["IsOrganizationApproved"]); if (reader["IsTaken"] != DBNull.Value) _visaRequest.IsTaken = Convert.ToBoolean(reader["IsTaken"]); if (reader["VisaAttachment"] != DBNull.Value) _visaRequest.VisaAttachment = Convert.ToString(reader["VisaAttachment"]); _visaRequest.NewRecord = false; } reader.Close(); return _visaRequest; }