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);
 }
 //History/Upcoming/Current
 public PrescriptionView(Prescription pPrescription, string pCaller)
 {
     InitializeComponent();
     prescription = pPrescription;
     patient.GetPatient(prescription.PatientID);
     Caller = pCaller;
     populatePreBoxFields();
 }
 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();
 }
        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();
        }
 public void TestGetSetPatientId()
 {
     Prescription r = new Prescription();
     r.PatientID = 1;
     Assert.True(r.PatientID == 1);
 }
 public void TestGetSetNotes()
 {
     Prescription r = new Prescription();
     r.Notes = "Test";
     Assert.True(r.Notes == "Test");
 }
 public void TestGetSetName()
 {
     Prescription r = new Prescription();
     r.PrescriptionName = "Test";
     Assert.True(r.PrescriptionName == "Test");
 }
 public void TestGetSetDoctor()
 {
     Prescription r = new Prescription();
     r.Doctor = 1;
     Assert.True(r.Doctor == 1);
 }
 public void TestSelectWithNoTid()
 {
     Prescription p = new Prescription();
     Assert.False(p.Select());
 }
示例#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();
        }
示例#11
0
 public void TestGetSetStatus()
 {
     Prescription r = new Prescription();
     r.Status = "Test";
     Assert.True(r.Status == "Test");
 }
示例#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;
 }