Beispiel #1
0
        public void BookAppointCorrect()
        {
            var resultrepo = new AppointmentRepository(mockContext.Object);
            var details    = new TestAppointment {
                Firstname = "Sujana", Lastname = "Maruvada", PaymentType = "Card"
            };
            var res = resultrepo.BookAppointment(details);

            Assert.AreEqual(1, res);
        }
Beispiel #2
0
 public static TestPatientAppointment FromRATestAppointment(this TestAppointment app)
 {
     return(new TestPatientAppointment()
     {
         apptID = app.apptID,
         MRN = app.unitnum,
         patientName = app.patientName,
         DOB = app.DOB,
         apptdatetime = app.apptdatetime
     });
 }
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     System.Collections.ArrayList appts = (System.Collections.ArrayList)(e.Argument);
     foreach (object o in appts)
     {
         TestAppointment to = (TestAppointment)o;
         Utilities.ParameterCollection pc = new RiskApps3.Utilities.ParameterCollection();
         pc.Add("apptID", to.apptID);
         BCDB2.Instance.RunSPWithParams("sp_AddTestPatientExclusion", pc);
     }
 }
 public int BookAppointment(TestAppointment t)
 {
     try
     {
         testAppointments.Add(t);
         return(1);
     }
     catch
     {
         return(0);
     }
 }
Beispiel #5
0
 public int BookAppointment(TestAppointment t)
 {
     try
     {
         _context.TestAppointments.Add(t);
         _context.SaveChanges();
         return(1);
     }
     catch
     {
         return(0);
     }
 }
 private void deleteBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     System.Collections.ArrayList appts = (System.Collections.ArrayList)(e.Argument);
     foreach (object o in appts)
     {
         TestAppointment to = (TestAppointment)o;
         Utilities.ParameterCollection pc = new RiskApps3.Utilities.ParameterCollection();
         pc.Add("apptID", to.apptID);
         pc.Add("purgeAuditData", 0);
         pc.Add("userLoginID", SessionManager.Instance.ActiveUser.userLogin);
         pc.Add("machineNameID", System.Environment.MachineName);
         pc.Add("applicationID", "RiskApps3 - DeleteTestAppointmentsPopup");
         BCDB2.Instance.RunSPWithParams("sp_deleteWebAppointment", pc);
     }
 }
 public IActionResult Post([FromBody] TestAppointment value)
 {
     try
     {
         _log4net.Error("Book new appointment is accessed.");
         if (ModelState.IsValid)
         {
             var b = _testAppointment.BookAppointment(value);
             if (b == 1)
             {
                 _log4net.Info("Appointment booked for Id: " + value.BookingId);
                 return(new OkObjectResult(value));
             }
             _log4net.Info("Error in booking for ID: " + value.BookingId);
         }
         _log4net.Error("Model state not valid. Check what you have entered");
         return(BadRequest());
     }
     catch
     {
         _log4net.Error("Error in Adding Booking Details");
         return(new NoContentResult());
     }
 }