public static IEnumerable<Disease> FindDiseases() { var diseases = new List<Disease>(); var sql = "SELECT Id, Name, Priority, RequiredTime, TimeUnit FROM Disease"; try { using ( var conn = new SqlConnection( ConnectionString ) ) { conn.Open(); using ( var cmd = new SqlCommand( sql, conn ) ) { cmd.CommandType = CommandType.Text; var dr = cmd.ExecuteReader(); while ( dr.Read() ) { var h = new Disease { Id = (DiseaseType) dr.GetInt16( 0 ), Name = dr.GetString( 1 ), Priority = (DiseasePriority) dr.GetInt16( 2 ), RequiredTime = dr.GetInt32( 3 ), TimeUnit = (RequiredTimeUnit) dr.GetInt16( 4 ) }; diseases.Add( h ); } } conn.Close(); } } catch (Exception ex) { s_logger.Error( "ERROR: {0}", ex.Message ); } return diseases; }
public PatientTakenInChargeByDoctor(int patientId, int hospitalId, DateTime takenInChargeByDoctorTime, int doctorId, Disease disease) { PatientId = patientId; HospitalId = hospitalId; TakenInChargeByDoctorTime = takenInChargeByDoctorTime; DoctorId = doctorId; Disease = disease; }
public PatientTakenInChargeByDoctor( int patientId, int hospitalId, DateTime takenInChargeByDoctorTime, int doctorId, Disease disease ) { PatientId = patientId; HospitalId = hospitalId; TakenInChargeByDoctorTime = takenInChargeByDoctorTime; DoctorId = doctorId; Disease = disease; }
public PatientArrival(int patientId, int hospitalId, Disease disease, DateTime arrivalTime) { PatientId = patientId; HospitalId = hospitalId; Disease = disease; ArrivalTime = arrivalTime; }