private async void GetAppointmentsAsync()
        {
            var appointments = await _databaseService.DentalAssistantDB.GetAppointmentsListAsync(FilterDate);

            Appointments.Clear();
            appointments.ForEach(Appointments.Add);
        }
Ejemplo n.º 2
0
 public void Clear()
 {
     Appointments.Clear();
     Resources.Clear();
     this.endDate            = this.startDate;
     this.appointmentsPerDay = 0;
 }
Ejemplo n.º 3
0
        public void SetUp(int dayCount, int resourceCount, int appointmentsPerDay)
        {
            if (dayCount <= 0 || resourceCount <= 0 || appointmentsPerDay <= 0)
            {
                return;
            }
            if (DayCount == dayCount && ResourceCount == resourceCount && AppointmentsPerDay == appointmentsPerDay)
            {
                return;
            }
            DayCount           = dayCount;
            ResourceCount      = resourceCount;
            AppointmentsPerDay = appointmentsPerDay;
            bool appointmentsPerDayChanged = this.appointmentsPerDay != appointmentsPerDay;
            bool resourcesUpdated          = UpdateResources(resourceCount);

            if (appointmentsPerDayChanged)
            {
                this.appointmentsPerDay = appointmentsPerDay;
                Appointments.Clear();
                this.endDate = this.startDate;
                UpdateDayCount(dayCount);
                return;
            }
            UpdateDayCount(dayCount);
            if (resourcesUpdated)
            {
                UpdateAppointmentResources();
            }
        }
Ejemplo n.º 4
0
        private void FetchAppointmentsExecute(DevExpress.XtraScheduler.FetchAppointmentsEventArgs e)
        {
            TimeInterval currentInterval = e.Interval as TimeInterval;

            if (lastFetchedInterval.Contains(currentInterval))
            {
                return;
            }
            lastFetchedInterval = currentInterval;
            //
            var entities = from entity in context.IHP_HARMONOGRAM_DZIENNY
                           where (entity.CZASSTART <lastFetchedInterval.End && entity.CZASSTOP> lastFetchedInterval.Start)
                           select entity;

            entities.Load();
            var Appo = context.IHP_HARMONOGRAM_DZIENNY.Local.ToList();

            Appointments.Clear();
            foreach (IHP_HARMONOGRAM_DZIENNY item in Appo)
            {
                //   item.TEMAT = item.ARIT_HARMONOGRAM.HODOWCA ;
                //  item.LABELID = 2;
                //  item.WagaSr = 22;
                Appointments.Add(item);
            }
        }
Ejemplo n.º 5
0
        private void Find()
        {
            var workingFilter   = string.Format("(workingfrom is null or workingfrom < '{0:yyyyMMdd HH:mm:ss}') and (workingtill is null or workingtill > '{1:yyyyMMdd HH:mm:ss}')", DateTill, DateFrom);
            var workFilter      = string.Format("workid in (select workid_r from wmsworking where {0})", workingFilter);
            var operationFilter = string.Format("operationcode in (select operationcode_r from wmswork where workid in (select workid_r from wmsworking where {0}))", workingFilter);
            var workerFilter    = string.Format("workerid in (select workerid_r from wmsworking where {0})", workingFilter);

            IEnumerable <Work> works;

            using (var mgr = IoC.Instance.Resolve <IBaseManager <Work> >())
                works = mgr.GetFiltered(workFilter);

            IEnumerable <Working> workings;

            using (var mgr = IoC.Instance.Resolve <IBaseManager <Working> >())
                workings = mgr.GetFiltered(workingFilter);

            IEnumerable <Worker> workers;

            using (var mgr = IoC.Instance.Resolve <IBaseManager <Worker> >())
                workers = mgr.GetFiltered(workerFilter);

            IEnumerable <BillOperation> operations;

            using (var mgr = IoC.Instance.Resolve <IBaseManager <BillOperation> >())
                operations = mgr.GetFiltered(operationFilter);

            // операции становятся
            Operations.Clear();
            foreach (var operation in operations)
            {
                var op = new OperationModel()
                {
                    Id = Operations.Count, Code = operation.OperationCode, Name = operation.OperationName, ClassCode = operation.OperationClassCode
                };
                Operations.Add(op);
            }

            // работники становятся ресурсами
            Resources.Clear();
            foreach (var worker in workers)
            {
                var res = new ResourceModel(worker);
                Resources.Add(res);
            }

            // выполнения становятся событиями
            Appointments.Clear();
            foreach (var working in workings)
            {
                var work      = works.First(i => i.GetKey <decimal>() == working.WORKID_R);
                var operation = Operations.First(i => i.Code == work.OPERATIONCODE_R);
                var worker    = Resources.First(i => i.Id == working.WORKERID_R);
                var label     = Labels.First(i => i.Code == operation.ClassCode);
                var a         = new AppointmentModel(working, operation, worker, label);
                Appointments.Add(a);
            }
        }
 private void RefreshAppointments()
 {
     Appointments.Clear();
     Appointments.Add(new Appointment()
     {
         Time  = DateTime.Now.Date.AddHours(17),
         Title = "Go shopping with Carolyn @ 10am"
     });
 }
Ejemplo n.º 7
0
        protected override async Task InitializeAsync()
        {
            Appointments.Clear();

            var appointments = await _myHealthClient.
                               AppointmentsService.GetPatientAppointmentsAsync(AppSettings.CurrentPatientId, MaxAppointmentsToList);

            if (appointments.Count > 0)
            {
                Appointments.AddRange(appointments);
            }

            AppointmentSelectedItem = Appointments.FirstOrDefault();
        }
Ejemplo n.º 8
0
        public void loadAppointments(DateTime?date)
        {
            if (date == null)
            {
                return;
            }
            DateTime temp = (DateTime)date;

            Appointments.Clear();
            List <Appointment> result = dbContext.Appointments.Where(a => a.Date.Day == temp.Day).ToList();

            foreach (Appointment a in result)
            {
                Appointments.Add(a);
            }
        }
Ejemplo n.º 9
0
        private async Task InitAppointments()
        {
            await RewnewAccessToken();

            Appointments.Clear();

            var result = await _appointmentsRepo.GetAllAsync();

            foreach (var e in result)
            {
                if (e != null)
                {
                    Appointments.Add(e);
                }
            }

            Debug.WriteLine("Appointment Count================== " + Appointments.Count);
        }
Ejemplo n.º 10
0
        private void RefreshCalendar()
        {
            DateTime endDate  = _submissiondate.AddDays(7);
            var      entities = from entity in context.IHP_HARMONOGRAM_DZIENNY
                                where (entity.CZASSTART > _submissiondate && entity.CZASSTART < endDate)
                                select entity;

            entities.Load();
            var Appo = context.IHP_HARMONOGRAM_DZIENNY.Local.ToList();

            Appointments.Clear();
            foreach (IHP_HARMONOGRAM_DZIENNY item in Appo)
            {
                //   item.TEMAT = item.ARIT_HARMONOGRAM.HODOWCA ;
                //  item.LABELID = 2;
                //  item.WagaSr = 22;
                Appointments.Add(item);
            }
        }
Ejemplo n.º 11
0
        //Method to call the instance of insertPatient from the PatientDB.
        //This method will be attached to the button 'Insert' command.
        private void UpdateAppointment()
        {
            try
            {
                rowsAffected = AppointmentDB.updateAppointment(SelectedAppointment);

                Appointments.Clear();
                DisplayAllAppointments();

                if (rowsAffected != 0)
                {
                    MessageBox.Show("Appointment updated");
                }
                else
                {
                    MessageBox.Show("Update Failed");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
Ejemplo n.º 12
0
        public async Task Initialize(Dispatcher dispatcher)
        {
            // read the settings from storage
            Settings.CopyFrom(await Storage.LoadSettings());
            if (Settings.SystemIdentifier == Guid.Empty)
            {
                // this only occurs when the system hasn't had one allocated
                // so we can create a new one, then save the settings.
                // (this will force an empty setting file with the System Identifier if needed)
                Settings.AllocateNewSystemIdentifier();
                await Storage.SaveSettings(Settings);
            }

            // read the room mappings from storage
            RoomMappings.Clear();
            foreach (var map in await Storage.LoadRoomMappings())
            {
                RoomMappings.Add(map);
            }

            Templates.Clear();
            foreach (var template in await Storage.LoadTemplates())
            {
                Templates.Add(template);
            }
            AddMissingTemplates();

            // reload any unmatched messages
            var messages = await Storage.LoadUnprocessableMessages(DisplayingDate);

            foreach (var item in messages)
            {
                UnprocessableMessages.Add(item);
            }

            PmsSimulator.Initialize(Storage);
            if (!IsSimulation)
            {
                FhirApptReader = new FhirAppointmentReader(FhirAppointmentReader.GetServerConnection);
                SmsProcessor.Initialize(Settings);
            }
            logger.Log(1, "Start up");
            if (!String.IsNullOrEmpty(Settings.AdministratorPhone))
            {
                logger.Log(1, "Send SMS to " + Settings.AdministratorPhone);
                try
                {
                    SmsProcessor.SendMessage(new SmsMessage(Settings.AdministratorPhone, "System is starting"));
                    if (!IsSimulation)
                    {
                        App.AdministratorPhone = Settings.AdministratorPhone;
                        App.SmsSender          = SmsProcessor;
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.MessageBox.Show("Error sending message: " + ex.Message);
                }
            }

            // setup the background worker routines
            ReadSmsMessage = new BackgroundProcess(Settings, serverStatuses.IncomingSmsReader, dispatcher, async() =>
            {
                // Logic to run on this process
                // (called every settings.interval)
                StatusBarMessage            = $"Last read SMS messages at {DateTime.Now.ToLongTimeString()}";
                var engine                  = PrepareMessagingEngine();
                List <PmsAppointment> appts = new List <PmsAppointment>();
                appts.AddRange(Appointments);
                var messagesReceived = await engine.SmsSender.ReceiveMessages();
                serverStatuses.IncomingSmsReader.Use(messagesReceived.Count());
                engine.ProcessIncomingMessages(appts, messagesReceived);
            });

            ScanAppointments = new BackgroundProcess(Settings, serverStatuses.AppointmentScanner, dispatcher, async() =>
            {
                // Logic to run on this process
                // (called every settings.interval)
                var engine = PrepareMessagingEngine();
                List <PmsAppointment> appts = await FhirApptReader.SearchAppointments(this.DisplayingDate, RoomMappings, Storage);
                serverStatuses.Oridashi.Use(1);
                serverStatuses.AppointmentScanner.Use(engine.ProcessTodaysAppointments(appts));

                // Now update the UI once we've processed it all
                Expecting.Clear();
                Waiting.Clear();
                Appointments.Clear();
                foreach (var appt in appts)
                {
                    Appointments.Add(appt);
                    if (appt.ArrivalStatus == Hl7.Fhir.Model.Appointment.AppointmentStatus.Booked)
                    {
                        Expecting.Add(appt);
                    }
                    else if (appt.ArrivalStatus == Hl7.Fhir.Model.Appointment.AppointmentStatus.Arrived)
                    {
                        Waiting.Add(appt);
                    }
                }
            });

            ProcessUpcomingAppointments = new BackgroundProcess(Settings, serverStatuses.UpcomingAppointmentProcessor, dispatcher, async() =>
            {
                // Logic to run on this process
                // (called every settings.intervalUpcoming)
                var engine = PrepareMessagingEngine();
                List <PmsAppointment> appts = new List <PmsAppointment>();
                appts.AddRange(await FhirApptReader.SearchAppointments(this.DisplayingDate.AddDays(1), RoomMappings, Storage));
                appts.AddRange(await FhirApptReader.SearchAppointments(this.DisplayingDate.AddDays(2), RoomMappings, Storage));
                serverStatuses.Oridashi.Use(1);
                serverStatuses.UpcomingAppointmentProcessor.Use(engine.ProcessUpcomingAppointments(appts));
            }, true);
        }