private void FillRegistrationInfoList(ref List <RegistrationInfo> registeredPatients, IDataReader reader) { RegistrationInfo regInfo = new RegistrationInfoImp(); while (reader.Read()) { Patient patient = new PatientImp(); patient.Name = reader["Name"].ToString(); patient.FirstName = reader["FirstName"] != null ? reader["FirstName"].ToString() : String.Empty; patient.BirthDate = UnsafeTypeCust.DbDateToDateTimeCust(reader["BirthDate"]); patient.DocumentAddress = String.Format("{0},{1},ул.{2},д.{3},кв.{4}", reader["Post"].ToString(), reader["City"].ToString(), reader["Street"].ToString(), reader["Hous"].ToString(), reader["Flat"].ToString()); patient.BirthDateString = String.Format("{0}.{1}.{2}", patient.BirthDate.Day, patient.BirthDate.Month, patient.BirthDate.Year); patient.BirthDateMsec = UnsafeTypeCust.ToJavaScriptMilliseconds(patient.BirthDate); regInfo.PatientData = patient; registeredPatients.Add(regInfo); } }
private void FillHospitalCards(ref List <HCard> hospitalCards, IDataReader reader) { HCard card = new HCardImp(); while (reader.Read()) { Patient patient = new PatientImp(); for (int i = 0; i < reader.FieldCount; i++) { patient.Name = reader["Name"].ToString(); patient.FirstName = reader["FirstName"] != null?reader["FirstName"].ToString():String.Empty; patient.BirthDate = UnsafeTypeCust.DbDateToDateTimeCust(reader["BirthDate"]); patient.DocumentAddress = String.Format("{0},{1},ул.{2},д.{3},кв.{4}", reader["Post"].ToString(), reader["City"].ToString(), reader["Street"].ToString(), reader["Hous"].ToString(), reader["Flat"].ToString()); } patient.BirthDateString = String.Format("{0}.{1}.{2}", patient.BirthDate.Day, patient.BirthDate.Month, patient.BirthDate.Year); card.PatientData = patient; hospitalCards.Add(card); } }