Ejemplo n.º 1
0
        async void Confirm(object sender, System.EventArgs e)
        {
            if (collection != null)
            {
                if (collection.Count > 0)
                {
                    var request = new NotifyResidentRequest();
                    request.waitingBookingTimeSlotList = new List <ConfirmedBookingTimeSlot>();
                    foreach (var item in collection)
                    {
                        if (item.notified)
                        {
                            request.waitingBookingTimeSlotList.Add(new ConfirmedBookingTimeSlot()
                            {
                                tid = item.tId
                            });
                        }
                    }

                    var res = await service.AddNotifyResident(App.Current.Properties["defaultPid"].ToString(), facilityId, unitID, tenantId, selectedDate, request);

                    if (res != null)
                    {
                        if (res.status_code == System.Net.HttpStatusCode.OK)
                        {
                            for (int i = 0; i < collection.Count; i++)
                            {
                                nonAvailableButtonArray[collection[i].tId].isSet = collection[i].notified;
                                nonAvailableButtonArray[collection[i].tId].SetState();
                            }
                            confirmModal.IsVisible = false;
                        }
                        else
                        {
                            await DisplayAlert("Error", res.message, "OK");
                        }
                    }
                    else
                    {
                        await DisplayAlert("Error", Config.CommonErrorMsg, "OK");
                    }
                }
            }
        }