Пример #1
0
        public void TestGetActiveRecords()
        {
            appointmentRepo.Setup(a => a.GetAllQuerable()).Returns(appointments.AsQueryable());

            var appointmentBL   = new AppointmentBL(appointmentRepo.Object);
            var appointmentList = appointmentBL.GetActiveCustomer();

            Assert.IsTrue(appointmentList.Count >= 0);
            Assert.IsTrue(appointmentList.All(s => s.Confirmation == "yes"));
        }
Пример #2
0
        /// <summary>
        /// I check the overlapping in this method. (Two appointments cant cover each other.)
        /// </summary>
        /// <param name="appointment"></param>
        /// <returns></returns>
        private static bool CheckForOverlapping(SchedulerReservations appointment)
        {
            AppointmentBL           appBL           = new AppointmentBL();
            List <BOL.APPOINTMENTS> newappointments = appBL.GetAll().Where(x => x.StartDate > DateTime.Now).ToList();

            foreach (var item in newappointments)
            {
                if (item.StartDate <= appointment.End && appointment.Start <= item.EndDate)
                {
                    return(false);
                }
            }
            return(true);
        }
        /// <summary>
        /// THe user can delete active appointments.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Delete(string id)
        {
            AppointmentBL appointmentBL = new AppointmentBL();

            try
            {
                appointmentBL.Delete(int.Parse(id));
                TempData["MsgS"] = "A törlés sikeres";
                return(RedirectToAction("Index"));
            }
            catch
            {
                TempData["MsgU"] = "A törlés sikertelen";
                return(RedirectToAction("Index"));
            }
        }
 public BookAnAppointmentController()
 {
     appBL        = new AppointmentBL();
     categBL      = new CategoryBL();
     reservations = new List <SchedulerReservations>();
 }
Пример #5
0
        /// <summary>
        /// This method calculate the next appointment ID
        /// </summary>
        /// <returns></returns>
        private static int CalculateAppointmentID()
        {
            AppointmentBL bl = new AppointmentBL();

            return(bl.GetAll().Last().ID + 1);
        }
Пример #6
0
        public static void ConvertToInsertAppointment(SchedulerReservations reservation)
        {
            AppointmentBL bl = new AppointmentBL();

            bl.Insert(CreateAPPOINTMENTSobject(reservation));
        }
Пример #7
0
 public AppointmentController()
 {
     _appointmentBL = new AppointmentBL();
 }
Пример #8
0
 public AppointmentController()
 {
     _repository                = IocConfig.GetInstance <AppointmentRepository>();
     _appointmentBL             = IocConfig.GetInstance <AppointmentBL>();
     _repositoryAppoinmentTypes = IocConfig.GetInstance <AppointmentTypesRepository>();
 }
Пример #9
0
 public void Setup()
 {
     _BL = new AppointmentBL();
 }