Example #1
0
        async Task OnSlotSelect(SchedulerSlotSelectEventArgs args)
        {
            Console.WriteLine($"SlotSelect: Start={args.Start} End={args.End}");

            Appointment data = await DialogService.OpenAsync <AddAppointmentPage>("Add Appointment",
                                                                                  new Dictionary <string, object> {
                { "Start", args.Start }, { "End", args.End }
            });

            if (data != null)
            {
                var appointment = await AppointmentsRepository.AddAppointment(data);

                if (appointment != null)
                {
                    //Appointments.Add(appointment);
                    // Either call the Reload method or reassign the Data property of the Scheduler
                    //await scheduler.Reload();
                }
                else
                {
                    NotificationService.Notify(new NotificationMessage
                    {
                        Severity = NotificationSeverity.Warning,
                        Detail   = "An error occured on the server. The appointment was not added.",
                        Duration = 30000,
                        Summary  = "Error"
                    });
                }
            }
        }
Example #2
0
        public override void TestInitialize()
        {
            base.TestInitialize();
            _appointments = new AppointmentsRepository();
            _clients      = new ClientsRepository();
            _treatments   = new TreatmentsRepository();
            _technicians  = new TechniciansRepository();
            _clientData   = GetRandom.Object <ClientData>();
            var c = new global::Delux.Domain.Client.Client(_clientData);

            _clients.Add(c).GetAwaiter();
            AddRandomClients();
            _treatmentData = GetRandom.Object <TreatmentData>();
            var tr = new global::Delux.Domain.Treatment.Treatment(_treatmentData);

            _treatments.Add(tr).GetAwaiter();
            AddRandomTreatments();
            _technicianData = GetRandom.Object <TechnicianData>();
            var te = new global::Delux.Domain.Technician.Technician(_technicianData);

            _technicians.Add(te).GetAwaiter();
            AddRandomTechnicians();

            Obj = new TestClass(_appointments, _clients, _treatments, _technicians);
        }
Example #3
0
        async Task OnAppointmentSelect(SchedulerAppointmentSelectEventArgs <Appointment> args)
        {
            Console.WriteLine($"AppointmentSelect: Appointment={args.Data.Text}");

            var result = await DialogService.OpenAsync <EditAppointmentPage>("Edit Appointment", new Dictionary <string, object> {
                { "Appointment", args.Data }
            });

            if (result == null)
            {
                // Deleted
                //await scheduler.Reload();
                return;
            }
            else if (!(await AppointmentsRepository.UpdateAppointment(args.Data)))
            {
                NotificationService.Notify(new NotificationMessage
                {
                    Severity = NotificationSeverity.Warning,
                    Detail   = "An error occured on the server. The appointment was not updated.",
                    Duration = 30000,
                    Summary  = "Error"
                });

                return;
            }
        }
Example #4
0
        public async Task DeleteAppointmentFromDatabase()
        {
            IFixture fixture = new Fixture();

            fixture.Behaviors.Add(new OmitOnRecursionBehavior());
            var databaseName = fixture.Create <string>();

            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName).Options;

            var appointment = fixture.Create <Appointment>();

            using (var context = new ApplicationDbContext(options))
            {
                var repository = new AppointmentsRepository(context);
                await repository.CreateAsync(appointment, CancellationToken.None);
            }

            using (var context = new ApplicationDbContext(options))
            {
                context.Appointments.Count().Should().Be(1);

                var repository = new AppointmentsRepository(context);
                await repository.DeleteAsync(appointment, CancellationToken.None);

                context.Appointments.Count().Should().Be(0);
            }
        }
Example #5
0
        public IEnumerable <Appointments> GetUserWiseAppointments(string email)
        {
            AppointmentsRepository     _appointmentservice = new AppointmentsRepository(System.Configuration.ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString);
            IEnumerable <Appointments> _appointments       = _appointmentservice.GetAppointmentByUser(email);

            return(_appointments);
        }
Example #6
0
        private void OnSaveButtonClicked(object sender, EventArgs e)
        {
            var repository = new AppointmentsRepository();

            repository.Add(doctorComboBox.SelectedDoctor.Name, dateTimePicker.SelectedDateTime);
            Close();
        }
Example #7
0
        static void Main(string[] args)
        {
            PetValidator petValidator = new PetValidator();
            string petsFilename = "..\\..\\..\\data\\pets.txt";
            PetsRepository petsRepository = new PetsRepository(petValidator, petsFilename);

            CustomerValidator customerValidator = new CustomerValidator();
            string customersFilename = "..\\..\\..\\data\\customers.txt";
            CustomersRepository customersRepository = new CustomersRepository(customerValidator, customersFilename);

            ServiceValidator serviceValidator = new ServiceValidator();
            string servicesFilename = "..\\..\\..\\data\\services.txt";
            ServicesRepository servicesRepository = new ServicesRepository(serviceValidator, servicesFilename);

            VetValidator vetValidator = new VetValidator();
            string vetsFilename = "..\\..\\..\\data\\vets.txt";
            VetsRepository vetsRepository = new VetsRepository(vetValidator, vetsFilename);

            AppointmentValidator appointmentValidator = new AppointmentValidator();
            string appointmentsFilename = "..\\..\\..\\data\\appointments.txt";
            AppointmentsRepository appointmentsRepository = new AppointmentsRepository(appointmentValidator, appointmentsFilename);

            Controller controller = new Controller(petsRepository, customersRepository, servicesRepository, vetsRepository,appointmentsRepository);

            runApp(controller);

        }
Example #8
0
 public Controller(PetsRepository petsRepository, CustomersRepository customersRepository, ServicesRepository servicesRepository, VetsRepository vetRepository, AppointmentsRepository appointmentsRepository)
 {
     this.petsRepository         = petsRepository;
     this.customersRepository    = customersRepository;
     this.servicesRepository     = servicesRepository;
     this.vetRepository          = vetRepository;
     this.appointmentsRepository = appointmentsRepository;
 }
Example #9
0
 public void SetUp()
 {
     petsRepository         = new PetsRepository(petValidator, petsFilename);
     customersRepository    = new CustomersRepository(customerValidator, customersFilename);
     servicesRepository     = new ServicesRepository(serviceValidator, servicesFilename);
     vetsRepository         = new VetsRepository(vetValidator, vetsFilename);
     appointmentsRepository = new AppointmentsRepository(appointmentValidator, appointmentsFilename);
 }
 public UnitOfWork()
 {
     _context        = new ApplicationDbContext();
     Doctors         = new DoctorsRepository(_context);
     Cities          = new CityRepository(_context);
     Appointments    = new AppointmentsRepository(_context);
     Specializations = new SpecializationRepository(_context);
     Patients        = new PatientsRepository(_context);
 }
Example #11
0
        async Task LoadData(SchedulerLoadDataEventArgs args)
        {
            if (!_eventsLoaded)
            {
                var startDate = args.Start;
                var endDate   = args.End;
                Appointments = await AppointmentsRepository.GetAppointmentsAsync(startDate, endDate);

                _eventsLoaded = true;
            }
        }
        public void GetAllAppointments()
        {
            // Arrange
            var repo = new AppointmentsRepository();

            // Act
            var result = repo.GetAllAppointments();

            // Assert
            Assert.Equal(3, result.Count);
        }
Example #13
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var repository = new AppointmentsRepository();

            services.AddSingleton <IAppointmentsRepository>(repository);

            var repository2 = new MedicalTestsRepository();

            services.AddSingleton <IMedicalTestsRepository>(repository2);

            services.AddControllersWithViews();
        }
        private void init()
        {
            _appointmentsRepository = new AppointmentsRepository();
            _allAppointments        = new ObservableCollection <AppointmentViewModel>();

            if (_appointmentsRepository == null)
            {
                throw new ArgumentNullException("Problem with fetching Data From Database");
            }

            this.createObservableAppointmentsFromList(_appointmentsRepository.GetAppointments(_allAppointmentsQuery));
        }
        public void DeleteAppointments()
        {
            // Arrange
            var repo         = new AppointmentsRepository();
            var appointments = new Appointments();

            // Act
            repo.DeleteAppointments(appointments);
            var result = repo.GetAllAppointments();

            // Assert
            Assert.Equal(3, result.Count);
        }
Example #16
0
        private void LoadAppointments()
        {
            var appointmentsRepository = new AppointmentsRepository();
            var searchPredicates       = GetSearchPredicates().ToArray();

            var results = from x in appointmentsRepository.Search(searchPredicates)
                          select new
            {
                Id     = x.Id,
                Doctor = x.Doctor.Name,
                Date   = x.StartDate
            };

            appointmentsDataGridView.DataSource = results.ToList();
        }
Example #17
0
        protected override void PopulateRelatedEntities(IndexVM model)
        {
            model.AppointmentsIndexVM               = model.AppointmentsIndexVM ?? new ViewModels.Appointments.IndexVM();
            model.AppointmentsIndexVM.Filter        = model.AppointmentsIndexVM.Filter ?? new ViewModels.Appointments.FilterVM();
            model.AppointmentsIndexVM.Filter.Prefix = "AppointmentsIndexVM.Filter";

            model.AppointmentsIndexVM.Pager              = model.AppointmentsIndexVM.Pager ?? new PagerVM();
            model.AppointmentsIndexVM.Pager.Prefix       = "AppointmentsIndexVM.Pager";
            model.AppointmentsIndexVM.Pager.Page         = model.AppointmentsIndexVM.Pager.Page <= 0 ? 1 : model.Pager.Page;
            model.AppointmentsIndexVM.Pager.ItemsPerPage = model.AppointmentsIndexVM.Pager.ItemsPerPage <= 0 ? 10 : model.AppointmentsIndexVM.Pager.ItemsPerPage;


            ActivitiesRepository aRepo        = new ActivitiesRepository();
            List <Activity>      dbActivities = aRepo.GetAll(a => true);

            List <SelectListItem> listItems = new List <SelectListItem>();

            listItems.Add(new SelectListItem()
            {
                Text  = "",
                Value = null
            });

            foreach (Activity activity in dbActivities)
            {
                listItems.Add(new SelectListItem()
                {
                    Text  = activity.Name,
                    Value = activity.Id.ToString()
                });
            }

            model.AppointmentsIndexVM.Filter.activitiesList = new SelectList(listItems, "Value", "Text", model.AppointmentsIndexVM.Filter.ActivityId.ToString() ?? null);

            Expression <Func <Appointment, bool> > Appointmentsfilter = model.AppointmentsIndexVM.Filter.GenerateFilter();

            model.AppointmentsIndexVM.OrderBy = model.AppointmentsIndexVM.OrderBy ?? new ViewModels.Appointments.OrderBy();
            Func <IQueryable <Appointment>, IOrderedQueryable <Appointment> > AppointmentsorderBy = model.AppointmentsIndexVM.OrderBy.orderBy();
            AppointmentsRepository repo = new AppointmentsRepository();

            model.AppointmentsIndexVM.Items            = repo.GetAll(Appointmentsfilter, model.AppointmentsIndexVM.Pager.Page, model.AppointmentsIndexVM.Pager.ItemsPerPage, AppointmentsorderBy);
            model.AppointmentsIndexVM.Pager.PagesCount = (int)Math.Ceiling(repo.Count(Appointmentsfilter) / (double)(model.AppointmentsIndexVM.Pager.ItemsPerPage));
        }
        public void CreateAppointments()
        {
            // Arrange
            var repo         = new AppointmentsRepository();
            var appointments = new Appointments()
            {
                Id       = Guid.NewGuid(),
                Date     = DateTime.Now,
                Name     = "Name Test",
                Phone    = 0773351279,
                TestType = TestType.ThyroidFunctionTests
            };

            // Act
            repo.CreateAppointments(appointments);
            var result = repo.GetAllAppointments();

            // Assert
            Assert.Equal(4, result.Count);
        }
Example #19
0
        public UnitOfWork(
            PatientsRepository patients,
            PractitionersRepository practitioners,
            PractitionerRolesRepository practitionerRoles,
            RelatedPeopleRepository relatedPeople,
            PeopleRepository people,
            OrganizationsRepository organizations,
            HealthcareServicesRepository healthcareServices,
            LocationsRepository locations,
            DevicesRepository devices,
            TasksRepository tasks,
            AppointmentsRepository appointments,
            SchedulesRepository schedules,
            EncountersRepository encounters,
            EpisodesOfCareRepository episodesOfCare,
            FlagsRepository flags
            )
        {
            var database = new FhirDevelopment01DB();

            Patients           = patients;
            Practitioners      = practitioners;
            PractitionerRoles  = practitionerRoles;
            RelatedPeople      = relatedPeople;
            People             = people;
            Organizations      = organizations;
            HealthcareServices = healthcareServices;
            Locations          = locations;
            Devices            = devices;
            Tasks          = tasks;
            Appointments   = appointments;
            Schedules      = schedules;
            Encounters     = encounters;
            EpisodesOfCare = episodesOfCare;
            Flags          = flags;
        }
Example #20
0
 public AppointmentsController()
 {
     _appointmentsRepository = new AppointmentsRepository(HesiraDB);
 }
Example #21
0
 public AppointmentsModule(AppointmentsRepository repository)
 {
     this.repository = repository;
 }
Example #22
0
 public AppointmentsController()
 {
     this._repository = new AppointmentsRepository();
 }
 public AppointmentService()
 {
     _repository = new AppointmentsRepository();
 }