Пример #1
0
        // end demo only stuff
        protected void Page_Load(object sender, EventArgs e)
        {
            //for demo purpose only
            //dump data for testing only
            resident = new Resident("David Mayor", "02-12345678");
            Doctor doctor1 = new Doctor("Yanni", "02-98765432");
            Doctor doctor2 = new Doctor("Cominal", "02-55667788");
            Carer carer1 = new Carer("Oreo Lingard", "02-11223344");
            Carer carer2 = new Carer("Lily", "02-99887766");
            resident.addDoctor(doctor1);
            resident.addDoctor(doctor2);
            resident.addCarer(carer1);
            resident.addCarer(carer2);
            //end dump testing data
            //end demo only stuff

            residentNameLabel.Text = resident.UserName;
            residentContactLabel.Text = resident.UserContact;
            doctorsBulletedList.Items.Clear();
            foreach (Doctor d in resident.associatedDoctors)
            {
                doctorsBulletedList.Items.Add(d.ToString());
            }
            carersBulletedList.Items.Clear();
            foreach (Carer c in resident.associatedCarers)
            {

                carersBulletedList.Items.Add(c.ToString());
            }

            //for demo purpose only
            //sensor generator setup
            heartRateSimulator = new RandomSensorGenerator(new Sensor((int)Sensor.SensorTypes.HEART_RATE, "HR-1", "-1"));
            bloodPressureSimulator = new RandomSensorGenerator(new Sensor((int)Sensor.SensorTypes.BLOOD_PRESSURE, "BP-1", "-1"));
            temperatureSimulator = new RandomSensorGenerator(new Sensor((int)Sensor.SensorTypes.TEMPERATURE, "BT-1", "-1"));
            bodyStatusSimulator = new RandomSensorGenerator(new Sensor((int)Sensor.SensorTypes.FAIL_STATUS, "MM-1", "False"));
            locationSimulator = new RandomSensorGenerator(new Sensor((int)Sensor.SensorTypes.GPS, "LS-1", "0,0"));
            //end sensor generator setup
            //end demo only stuff
        }
Пример #2
0
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();

            //
            List<Resident> residentsList = new List<Resident>();
            List<Doctor> doctorsList = new List<Doctor>();
            List<Carer> carersList = new List<Carer>();
            List<Reminder> reminders = new List<Reminder>();

            //dummy testing data only
            //for demo purpose only
            //residents
            Resident resident1 = new Resident("David Mayor", "02-12345678");
            resident1.UserPassword = "******";
            Resident resident2 = new Resident("Norman", "02-98765432");
            resident2.UserPassword = "******";
            Resident resident3 = new Resident("Patrick", "03-75419862");
            resident3.UserPassword = "******";
            Resident resident4 = new Resident("Elizebath", "03-41569852");
            resident4.UserPassword = "******";
            Resident resident5 = new Resident("Parramata", "02-12578462");
            //doctors
            Doctor doctor1 = new Doctor("Yanni", "02-98765432");
            doctor1.UserPassword = "******";
            Doctor doctor2 = new Doctor("Cominal", "02-55667788");
            doctor2.UserPassword = "******";
            Doctor doctor3 = new Doctor("Weather Man", "03-48512697");
            doctor3.UserPassword = "******";
            //carers
            Carer carer1 = new Carer("Oreo Lingard", "02-11223344");
            carer1.UserPassword = "******";
            Carer carer2 = new Carer("Lily", "02-99887766");
            carer2.UserPassword = "******";
            Carer carer3 = new Carer("Omo", "03-74620139");
            carer3.UserPassword = "******";

            //resident relationships
            resident1.addDoctor(doctor1);
            resident1.addDoctor(doctor2);
            resident1.addCarer(carer1);
            resident1.addCarer(carer2);
            resident2.addDoctor(doctor2);
            resident2.addCarer(carer2);
            resident2.addCarer(carer3);
            resident3.addDoctor(doctor1);
            resident3.addDoctor(doctor3);
            resident3.addCarer(carer3);
            resident4.addDoctor(doctor2);
            resident4.addCarer(carer2);
            resident5.addDoctor(doctor3);
            resident5.addCarer(carer1);

            //doctor's resident list
            doctor1.LinkResident(resident1);
            doctor1.LinkResident(resident3);
            doctor2.LinkResident(resident1);
            doctor2.LinkResident(resident2);
            doctor2.LinkResident(resident4);
            doctor3.LinkResident(resident3);
            doctor3.LinkResident(resident5);

            //carer's resident list
            carer1.LinkResident(resident1);
            carer1.LinkResident(resident5);
            carer2.LinkResident(resident1);
            carer2.LinkResident(resident2);
            carer2.LinkResident(resident4);
            carer3.LinkResident(resident2);
            carer3.LinkResident(resident3);

            //add all peopel to the list
            residentsList.Add(resident1);
            residentsList.Add(resident2);
            residentsList.Add(resident3);
            residentsList.Add(resident4);
            residentsList.Add(resident5);
            doctorsList.Add(doctor1);
            doctorsList.Add(doctor2);
            doctorsList.Add(doctor3);
            carersList.Add(carer1);
            carersList.Add(carer2);
            carersList.Add(carer3);
            //end demo only stuff
            //end dummy testing data
        }
Пример #3
0
 public void addDoctor(Doctor doctor)
 {
     associatedDoctors.Add(doctor);
 }