Exemplo n.º 1
0
 public UserControl_AddRoom(Ward ward, UserControl_Wards parentUC)
 {
     InitializeComponent();
     room = new Room();
     _Ward = ward;
     ParentWardsWindow = parentUC as UserControl_Wards;
 }
Exemplo n.º 2
0
        public void TestEditPatientInWaitlist()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UTW", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UTW");
            b.Insert();
            Patient p = new Patient(10000, "Test-WLP", "Test-WLP", new DateTime(), "", "", "", "", "", "", "");
            p.Insert();
            p.Select();
            Treatment treat = new Treatment(p.PatientID, "UnitTestTreatment-WLP", 1, 1, 1, "", "", 1, "Upcoming");
            treat.Insert();
            List<Treatment> list = Treatment.GetTreatments(p.PatientID, "Upcoming");
            Treatment t = list[0];

            WaitlistedPatient.AddPatientToWaitlist(p.PatientID, "UTW", "High", t.TreatmentID);
            List<WaitlistedPatient> patients = WaitlistedPatient.GetWaitlistedPatientsForWard("UTW");

            Assert.True(WaitlistedPatient.EditPatientInWaitlist(p.PatientID, "UTW", "High", t.TreatmentID));

            patients[0].RemovedPatientFromWaitlist();
            t.Delete();
            p.Delete();
            b.Delete();
            r.Delete();
            w.Delete();
        }
Exemplo n.º 3
0
        public void TestWardInsert()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            Assert.True(ward.Insert());

            ward.Delete();
        }
Exemplo n.º 4
0
        public void TestGetBeds()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            ward.Insert();
            Room room = new Room(1, "UnitTestWard", 1);
            room.Insert();
            List<Bed> beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 0);

            Bed bed = new Bed(1, Bed.States.Available, 0, 1, "", "UnitTestWard");
            bed.Insert();

            beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 1);

            Bed bed2 = new Bed(2, Bed.States.Available, 0, 1, "", "UnitTestWard");
            bed2.Insert();

            beds = Bed.GetBeds(1, "UnitTestWard");
            Assert.True(beds.Count == 2);

            bed2.Delete();
            bed.Delete();
            room.Delete();
            ward.Delete();
        }
Exemplo n.º 5
0
 public UserControl_AddWard(Ward Ward, UserControl_Wards parentUC)
 {
     InitializeComponent();
     _isNewWard = false;  //A new patient will not have a health care no to reference
     ward = Ward;
     ParentWardsWindow = parentUC as UserControl_Wards;
 }
Exemplo n.º 6
0
 public UserControl_AddRoom(Room Room, Ward ward, UserControl_Wards parentUC)
 {
     InitializeComponent();
     _isNewRoom = false;  //A new patient will not have a health care no to reference
     room = Room;
     _Ward = ward;
     ParentWardsWindow = parentUC as UserControl_Wards;
 }
Exemplo n.º 7
0
        public void TestGetWards()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            ward.Insert();

            List<Ward> w = Ward.GetWards();
            Assert.True(w.Count >= 1);

            ward.Delete();
        }
Exemplo n.º 8
0
 public static List<Ward> GetWards()
 {
     List<object[]> wards = Database.Select("Select * FROM Ward");
     List<Ward> getwards = new List<Ward>();
     if (wards != null)
     foreach (object[] row in wards)
     {
         Ward newWard = new Ward(row[0].ToString(), row[1].ToString());
         getwards.Add(newWard);
     }
     return getwards;
 }
Exemplo n.º 9
0
 public void TestSelectWithInvalidWard()
 {
     Ward w = new Ward("InvalidWard");
     Assert.False(w.Select());
 }
Exemplo n.º 10
0
 public void TestOverrideToString()
 {
     Ward w = new Ward();
     w.WardName = "Test";
     Assert.True(w.ToString() == "Test");
 }
Exemplo n.º 11
0
 public void TestGetSetWardSlug()
 {
     Ward w = new Ward();
     w.SlugName = "Test";
     Assert.True(w.SlugName == "Test");
 }
Exemplo n.º 12
0
        public void TestGetOpenBedsForWardWithValidWard()
        {
            Ward w = new Ward("UnitTestWard-WLP", "UTW");
            w.Insert();
            Room r = new Room(1, "UnitTestWard-WLP", 1);
            r.Insert();
            Bed b = new Bed(1, Bed.States.Available, 0, 1, "", "UnitTestWard-WLP");
            b.Insert();

            List<Bed> bed = WaitlistedPatient.GetOpenBedsForWard("UnitTestWard-WLP");
            Assert.True(bed.Count >= 1);

            b.Delete();
            r.Delete();
            w.Delete();
        }
Exemplo n.º 13
0
        private bool _isNewWard = true; //To use the same window for edits and adds.

        #endregion Fields

        #region Constructors

        //Required for databinding -- END
        public UserControl_AddWard(UserControl_Wards parentUC)
        {
            InitializeComponent(); //New patient can use default constructor
            ward = new Ward();
            ParentWardsWindow = parentUC as UserControl_Wards;
        }