コード例 #1
0
 public UserControl_AddRoom(Ward ward, UserControl_Wards parentUC)
 {
     InitializeComponent();
     room = new Room();
     _Ward = ward;
     ParentWardsWindow = parentUC as UserControl_Wards;
 }
コード例 #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();
        }
コード例 #3
0
ファイル: WardClassTests.cs プロジェクト: trbielec/hospipal
        public void TestWardInsert()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            Assert.True(ward.Insert());

            ward.Delete();
        }
コード例 #4
0
ファイル: BedClassTests.cs プロジェクト: trbielec/hospipal
        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();
        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #7
0
ファイル: WardClassTests.cs プロジェクト: trbielec/hospipal
        public void TestGetWards()
        {
            Ward ward = new Ward("UnitTestWard", "UTW");
            ward.Insert();

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

            ward.Delete();
        }
コード例 #8
0
ファイル: Ward.cs プロジェクト: trbielec/hospipal
 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;
 }
コード例 #9
0
ファイル: WardClassTests.cs プロジェクト: trbielec/hospipal
 public void TestSelectWithInvalidWard()
 {
     Ward w = new Ward("InvalidWard");
     Assert.False(w.Select());
 }
コード例 #10
0
ファイル: WardClassTests.cs プロジェクト: trbielec/hospipal
 public void TestOverrideToString()
 {
     Ward w = new Ward();
     w.WardName = "Test";
     Assert.True(w.ToString() == "Test");
 }
コード例 #11
0
ファイル: WardClassTests.cs プロジェクト: trbielec/hospipal
 public void TestGetSetWardSlug()
 {
     Ward w = new Ward();
     w.SlugName = "Test";
     Assert.True(w.SlugName == "Test");
 }
コード例 #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();
        }
コード例 #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;
        }