public StatAvgAppointmentDurationActor( Hospital hospital )
        {
            _hospital = hospital;
            _subscriptions = new HashSet<IActorRef>();

            Processing();
        }
        public StatEstimatedTimeToSeeADoctorActor( Hospital hospital )
        {
            _hospital = hospital;
            _subscriptions = new HashSet<IActorRef>();

            Processing();
        }
Пример #3
0
        public HospitalCoordinatorActor( Hospital hospital, IActorRef dashboardActor )
        {
            _hospital = hospital;
            _dashboardActor = dashboardActor;
            _hospitalStatActors = new Dictionary<StatisticType, IActorRef>();

            Processing();
        }
Пример #4
0
        public HospitalEventFetcherActor( Hospital hospital )
        {
            _hospital = hospital;
            _subscriptions = new HashSet<IActorRef>();
            _diseases = new Dictionary<DiseaseType, Disease>();

            Paused();
        }
Пример #5
0
        public static IEnumerable<Hospital> FindHospitals()
        {
            var hospitals = new List<Hospital>();

            var sql = "SELECT Id, Name, AssignedDoctors FROM Hospital ORDER BY Name";

            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 Hospital
                            {
                                Id = dr.GetInt32( 0 ),
                                Name = dr.GetString( 1 ),
                                AssignedDoctors = dr.GetInt32( 2 )
                            };

                            hospitals.Add( h );
                        }
                    }

                    conn.Close();
                }
            }
            catch ( Exception ex )
            {
                s_logger.Error( "ERROR: {0}", ex.Message );
            }

            return hospitals;
        }