示例#1
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private void BtnBook_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Book button clicked. Only possible if there is atleast one appointment slot available.
        ///			Mobile client is informed when this happens with a notification
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///-------------------------------------------------------------------------------------------------
        private void BtnBook_Click(object sender, RoutedEventArgs e)
        {
            int i = lstRequests.SelectedIndex;

            if (i >= 0)
            {
                // Get HoH (unless they are the hoh)
                Patient hoh    = null;
                string  hohHCN = patients[i].GetHoH();
                if (hohHCN != patients[i].HCN)
                {
                    hoh = Database.Patients[hohHCN];
                }

                bool booked = SchedulingSupport.BookAppointment(patients[i], hoh, requests[i].Date);

                if (!booked)
                {
                    Cancel();
                }

                SubmitResponse(patients[i].HCN, booked ? BuildResponseBook(requests[i].Date) : BuildResponseReject(requests[i].Date));
                LoadRequests();
            }
        }