Exemple #1
0
        //public List<BookingDTO> GetBookings(DateTime FromDate, DateTime ToDate)
        //{
        //    try
        //    {
        //        return GetBookings(FromDate, ToDate, ENums.BookingStatusTypes.NONE);
        //    }
        //    catch (Exception exp)
        //    {
        //        throw exp;
        //    }
        //}

        public List <ViewBookingDTO> GetBookings(cdtGetBookingsInput getBookingsInput)
        {
            try
            {
                if (bookingHelper == null)
                {
                    bookingHelper = new BookingHelper();
                }
                return(bookingHelper.GetBookings(getBookingsInput));
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
        async public void SetList()
        {
            try
            {
                bool check = false;

                Tuple <string, RoomBookingModel> data = await BookingHelper.GetBookings(CurrentRoom.Id);

                if (!string.IsNullOrEmpty(data.Item1))
                {
                    Activity.RunOnUiThread(() =>
                    {
                        Toast.MakeText(Activity, data.Item1, ToastLength.Short).Show();
                    });
                    return;
                }
                RoomBookingModel          model = data.Item2;
                List <BookingDetailModel> list  = model.data;

                //List<BookingDetailModel> list = await BookingHelper.GetBookings(CurrentRoom.Id);
                if (BookingList != null && BookingList.Count > 0)
                {
                    check = list.Equals(BookingList);
                }
                BookingList = list;
                if (!check)
                {
                    InvokeSetList?.Invoke(list, EventArgs.Empty);
                }
            }
            catch (Exception exc)
            {
            }
            finally
            {
                Activity.RunOnUiThread(() =>
                {
                    Activity.ProgressBar.Visibility = ViewStates.Gone;
                });
            }
        }