Exemplo n.º 1
0
 public void TestGetSetEndDateString()
 {
     Prescription r = new Prescription();
     r.EndDate = new MySqlDateTime(new DateTime(2012, 12, 12));
     String date = r.EndDate.ToString();
     Assert.True(r.EndDateToShortDateString == date);
 }
Exemplo n.º 2
0
 //History/Upcoming/Current
 public PrescriptionView(Prescription pPrescription, string pCaller)
 {
     InitializeComponent();
     prescription = pPrescription;
     patient.GetPatient(prescription.PatientID);
     Caller = pCaller;
     populatePreBoxFields();
 }
Exemplo n.º 3
0
 public void TestCheckDatesForStatusChanges()
 {
     Prescription p = new Prescription(100000, 1, "Test-Prescription", "Test-Notes", new DateTime(2013,4,6), new DateTime(2013,4,6), "Upcoming");
     p.Insert();
     Prescription.CheckDatesForStatusChanges();
     p.Select();
     Assert.True(p.Status == "History");
     p.Delete();
 }
Exemplo n.º 4
0
        public void TestGetPrescriptions()
        {
            Prescription p = new Prescription(100000, 1, "Test-Prescription", "Test-Notes", new DateTime(), new DateTime(), "Test");

            p.Insert();
            List<Prescription> list = Prescription.GetPrescriptions(100000, "Test");
            Assert.True(list.Count >= 1);

            Prescription prescription = list[0];
            prescription.Delete();
        }
Exemplo n.º 5
0
 public void TestGetSetPatientId()
 {
     Prescription r = new Prescription();
     r.PatientID = 1;
     Assert.True(r.PatientID == 1);
 }
Exemplo n.º 6
0
 public void TestGetSetNotes()
 {
     Prescription r = new Prescription();
     r.Notes = "Test";
     Assert.True(r.Notes == "Test");
 }
Exemplo n.º 7
0
 public void TestGetSetName()
 {
     Prescription r = new Prescription();
     r.PrescriptionName = "Test";
     Assert.True(r.PrescriptionName == "Test");
 }
Exemplo n.º 8
0
 public void TestGetSetDoctor()
 {
     Prescription r = new Prescription();
     r.Doctor = 1;
     Assert.True(r.Doctor == 1);
 }
Exemplo n.º 9
0
 public void TestSelectWithNoTid()
 {
     Prescription p = new Prescription();
     Assert.False(p.Select());
 }
Exemplo n.º 10
0
        public void TestPrescriptionUpdate()
        {
            Prescription p = new Prescription(100000, 1, "Test-Prescription", "Test-Notes", new DateTime(), new DateTime(), "Test");

            p.Insert();
            List<Prescription> list = Prescription.GetPrescriptions(100000, "Test");

            Prescription prescription = list[0];
            prescription.Notes = "TEST NOTES";
            Assert.True(prescription.Update());

            prescription.Delete();
        }
Exemplo n.º 11
0
 public void TestGetSetStatus()
 {
     Prescription r = new Prescription();
     r.Status = "Test";
     Assert.True(r.Status == "Test");
 }
Exemplo n.º 12
0
 public static List<Prescription> GetPrescriptions(int pid,string status)
 {
     List<object[]> rows = Database.Select("Select * FROM Prescription WHERE pid = " + pid + " AND prescriptionstatus = '" + status + "'");
     List<Prescription> getPrescriptions = new List<Prescription>();
     if (rows != null)
     foreach (object[] row in rows)
     {
         Prescription prescription = new Prescription(Convert.ToInt32(row[1]), Convert.ToInt32(row[2]),
                                 row[3].ToString(), row[4].ToString(), Convert.ToDateTime(row[5]),
                                 Convert.ToDateTime(row[6]), row[7].ToString());
         prescription._prescriptionID = Convert.ToInt32(row[0]);
         getPrescriptions.Add(prescription);
     }
     return getPrescriptions;
 }