public CreateAppointmentForm(CalendarForm calendarForm, AppointmentController appointmentController, UserController userController)
 {
     InitializeComponent();
     calendar = calendarForm;
     AddUserNamesToAllUserNamesList();
     allUserNamesListBox.DataSource     = allUserNames;
     invitedUserNamesListBox.DataSource = invitedUserNames;
     this.appointmentController         = appointmentController;
     this.userController = userController;
 }
Ejemplo n.º 2
0
 private void CalculateFinishedAppointments()
 {
     foreach (var appointment in AppointmentController.getInstance().GetAppointmentsByPatient(_loggedInPatient))
     {
         if (AppointmentIsFinished(appointment))
         {
             _loggedInPatient.Activity.NumberOfFinishedAppointmentsSinceReview++;
         }
     }
 }
Ejemplo n.º 3
0
        public void Initialize()
        {
            vm = new AppointmentController();
            var calendarMock = MockRepository.GenerateMock <StorageContext>();

            calendarMock.Appointments = MockRepository.GenerateMock <DbSet <Appointment> >();
            calendarMock.People       = MockRepository.GenerateMock <DbSet <Person> >();
            calendarMock.Attendances  = MockRepository.GenerateMock <DbSet <Attendance> >();
            vm.CalendarModel          = new CalendarModel(new StorageTest(calendarMock));
        }
        public AppointmentControllerTests()
        {
            Random random = new Random();

            _options = new DbContextOptionsBuilder <HospitalContext>()
                       .UseInMemoryDatabase(databaseName: "HospitalTestDb" + random.Next(int.MinValue, int.MaxValue))
                       .Options;

            _controller = new AppointmentController(_options);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor for the edit visit information form
 /// </summary>
 /// <param name="viewVisitForm">the referring form</param>
 public EditVisitForm(ViewVisitForm viewVisitForm, int appointmentId, int nurseId)
 {
     InitializeComponent();
     this.viewVisitForm            = viewVisitForm;
     this.theVisitController       = new VisitController();
     this.theAppointmentController = new AppointmentController();
     this.theAppointment           = this.theAppointmentController.GetAppointment(appointmentId);
     this.nurseId = nurseId;
     this.InitializeFormData();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// New appointment constructor
 /// </summary>
 public SearchPatient()
 {
     InitializeComponent();
     personController      = new PersonController();
     appointmentController = new AppointmentController();
     visitController       = new VisitController();
     patient                = new UserDTO();
     appointmentDTO         = new AppointmentDTO();
     this.patientController = new PatientController();
 }
Ejemplo n.º 7
0
 public SummaryViewPresenter(
     [CreateNew] AppointmentController controller,
     [ServiceDependency] IStateProvider state,
     [ServiceDependency] INavigationService nagivator
     )
 {
     _controller = controller;
     _state      = state;
     _navigator  = nagivator;
 }
 public CreateAppointment(UserInfo info, Patient currentPatient)
 {
     InitializeComponent();
     this.currentPatient   = currentPatient;
     doctorController      = new DoctorController();
     patientController     = new PatientController();
     appointmentController = new AppointmentController();
     userID           = info;
     lblUserName.Text = userID.userID;
 }
Ejemplo n.º 9
0
        public void CalendarAppointments_SomeApponintmentsList_ReturnsSameAppointmensList()
        {
            List <IAppointment> mockAppointmentsList = new List <IAppointment>()
            {
                mockAppointment.Object
            };

            AppointmentController.AssignCalendarAppointments(mockAppointmentsList);
            Assert.AreEqual(mockAppointmentsList, AppointmentController.CalendarAppointments);
        }
Ejemplo n.º 10
0
        public bool IsValid(object owner, Condition condition)
        {
            if (!(owner is AppointmentController))
            {
                return(false);
            }
            AppointmentController controller = (AppointmentController)owner;

            return(controller.IsSelected);
        }
        public EditAppointmentPage(Patient patient)
        {
            InitializeComponent();
            AppointmentDataGrid.ItemsSource = AppointmentController.getInstance().GetAppointments();
            var days = new List <DayOfWeek>();

            days.Add(DayOfWeek.Monday);
            days.Add(DayOfWeek.Tuesday);
            this.patient = patient;
            RefreshTable();
        }
        public void Delete()
        {
            // Arrange
            AppointmentController controller = new AppointmentController();

            // Act
            var result = controller.Deleteappointment(106);

            // Assert
            Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <appointment>));
        }
        public List <Appointment> GenerateAppointments(Doctor selectedDoctor, Patient patient, DateTime startDateTime, DateTime endDateTime)
        {
            List <Appointment> recommendedAppointments = AppointmentController.getInstance().GenerateFreeAppointments(selectedDoctor, patient, startDateTime.AddDays(-3), endDateTime.AddDays(3));

            if (!recommendedAppointments.Any())
            {
                recommendedAppointments = AppointmentController.getInstance().GenerateAppointmentsForDoctorsOfSameSpecialization(selectedDoctor, patient, startDateTime, endDateTime);
            }

            return(recommendedAppointments);
        }
        public void CreateAppointmentAction_LoadsCreateAppointmentPage_ReturnsCreateAppointmentView()
        {
            //Arrange
            var controller = new AppointmentController(logger.Object, appointmentRepo.Object, practitionerRepo.Object, patientRepo.Object, userRepo.Object, validator.Object);

            //Act
            var result = controller.CreateAppointment() as ViewResult;

            //Assert
            Assert.AreEqual("CreateAppointment", result.ViewName);
        }
Ejemplo n.º 15
0
 private void Deserialize()
 {
     EquipmentController.getInstance().loadFromFile();
     RoomController.GetInstance().LoadRoomsFromFile();
     MedicineController.GetInstance().LoadAll();
     DoctorController.getInstance().LoadFromFile();
     NotificationController.GetInstance().LoadFromFile();
     PatientController.getInstance().LoadFromFile();
     AppointmentController.getInstance().LoadAppointmentsFromFile();
     AccountController.GetInstance().LoadFromFile();
 }
        public void GetCreateShouldReturnView()
        {
            //Arrange
            var controller = new AppointmentController(null, null);
            var name       = "Gosho";
            // Act
            var result = controller.Create(name);

            // Assert
            result.Should().BeOfType <ViewResult>();
        }
Ejemplo n.º 17
0
 private async void _MedPractName_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (_MedPractName.Text.Length >= 3)
     {
         await HandleSearch();
     }
     else
     {
         await AppointmentController.ListMedicalPractioner(_ParentStack, MedicalPractitionerType.Laboratory);
     }
 }
Ejemplo n.º 18
0
        public void AppointmentIndex_ReturnsAViewResult()
        {
            //ARRANGE
            var testController = new AppointmentController(CreateIRepository());

            //ACT
            var result = testController.Index();

            //ASSERT
            Assert.IsType <ViewResult>(result);
        }
Ejemplo n.º 19
0
 private void ShowMonth()
 {
     calendarGridView.Rows.Clear();
     appointmentsInMonth = AppointmentController.GetAppointmentsInMonth(selectedDate);
     UpdateBasicMonthInformation();
     MakeMonthTable();
     if (selectedDate == DateTime.Today)
     {
         PaintToday();
     }
 }
        public void DeleteAppointmentAction_ValidDelete_RedirectsToViewAppointments()
        {
            //Arrange
            var controller = new AppointmentController(logger.Object, appointmentRepo.Object, practitionerRepo.Object, patientRepo.Object, userRepo.Object, validator.Object);

            //Act
            var result = controller.DeleteAppointment(It.IsAny <int>()) as RedirectToActionResult;

            // Assert
            Assert.That(result.ActionName, Is.EqualTo("ViewAppointments"));
        }
        public void GetById()
        {
            // Arrange
            AppointmentController controller = new AppointmentController();

            // Act
            var result = controller.Getappointment(64);

            // Assert
            Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <appointment>));
        }
        public void UpdateAppointmentAction_NullAppointment_ReturnsBadRequest()
        {
            //Arrange
            var controller = new AppointmentController(logger.Object, appointmentRepo.Object, practitionerRepo.Object, patientRepo.Object, userRepo.Object, validator.Object);

            //Act
            var result = controller.UpdateAppointment(null);

            // Assert
            Assert.IsInstanceOf(typeof(BadRequestObjectResult), result);
        }
 private static void Serialize()
 {
     EquipmentController.getInstance().saveInFile();
     RoomController.GetInstance().SaveRoomsInFile();
     MedicineController.GetInstance().Serialization();
     DoctorController.getInstance().SaveInFlie();
     NotificationController.GetInstance().SaveInFile();
     PatientController.getInstance().SaveInFile();
     AppointmentController.getInstance().SaveAppointmentsInFile();
     AccountController.GetInstance().SaveInFile();
 }
Ejemplo n.º 24
0
        public DailySchedule()
        {
            var app = Application.Current as App;

            appointmentController = app.appointmentController;

            InitializeComponent();
            DatePicker_Schedule.SelectedDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day);

            SetDataGrid();
        }
        private void FormSessions_Load(object sender, EventArgs e)
        {
            monthCalendar.MinDate = DateTime.Today;
            monthCalendar.MaxDate = DateTime.Today.AddDays(14);

            shortDate = monthCalendar.SelectionRange.Start.ToShortDateString();
            //MessageBox.Show(GetDoctorId.ToString());

            appointmentController = new AppointmentController();
            CreateSession(DateTime.Today);
        }
        public void Get()
        {
            // Arrange
            AppointmentController controller = new AppointmentController();

            // Act
            IQueryable <appointment> result = controller.Getappointments();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreNotSame(0, result.Count());
        }
 public ModifyVisitInfo(UserInfo info, int visitID, string patientID, bool flag, string apptDateTime)
 {
     this.visitID   = visitID;
     this.patientID = patientID;
     InitializeComponent();
     visitsController = new VisitsController();
     apptController   = new AppointmentController();
     diagController   = new DiagnosesController();
     userID           = info;
     this.apptText    = apptDateTime;
     lblUserName.Text = userID.userID;
 }
Ejemplo n.º 28
0
        public void GetAll_Test()
        {
            // Arrange
            var mockService = new Mock <IAppointmentService>();
            var controller  = new AppointmentController(mockService.Object);

            // Act
            IQueryable <AppointmentModel> response = controller.GetAll();

            // Assert
            Assert.IsNotNull(response);
        }
Ejemplo n.º 29
0
        private DataGridViewTextBoxCell GetDayCellNonEmptyInMonthView()
        {
            DataGridViewTextBoxCell cell             = new DataGridViewTextBoxCell();
            DateTime           day                   = new DateTime(selectedDate.Year, selectedDate.Month, iteratorDay);
            List <Appointment> appointmentsInThisDay = AppointmentController.GetAppointmentsInThisTimePeriod(appointmentsInMonth, day, calendarDisplayMenuListBox.SelectedItem.ToString());
            string             cellText              = GetCellTextInWeekView(appointmentsInThisDay, day);

            cell.Value = cellText;
            cell.Tag   = appointmentsInThisDay;
            iteratorDay++;
            return(cell);
        }
Ejemplo n.º 30
0
        public void GetById_NotFound_Test()
        {
            // Arrange
            var mockService = new Mock <IAppointmentService>();
            var controller  = new AppointmentController(mockService.Object);

            // Act
            IHttpActionResult actionResult = controller.GetById(-1);

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult));
        }