public RatingPopup(int customerid, MyBookingModel myBookingModel)
        {
            InitializeComponent();
            MyBookingModel = myBookingModel;
            CurrentUserId  = customerid;
            ToUserID       = MyBookingModel.ServiceProviderId.Value;

            if (MyBookingModel.UserRating != null)
            {
                customerratingview.IsVisible = false;
                SpRating       = MyBookingModel.UserRating.Value;
                spComment.Text = MyBookingModel.UserReview;
            }
            else
            {
                customerratingview.IsVisible = true;
            }

            webApiRestClient = new WebApiRestClient();
        }
 public JobDetailPage(MyBookingModel bookingListTap = null)
 {
     InitializeComponent();
     BindingContext = new JobDetailViewModel(Navigation, bookingListTap);
 }
Exemplo n.º 3
0
        public MyBookingViewModel(INavigation navigation) : base(navigation)
        {
            UserID              = CurrentUserId;
            PendingBgColor      = StaticHelpers.BlueColor;
            PendingtextColor    = StaticHelpers.WhiteColor;
            InprogressBgColor   = StaticHelpers.GrayColor;
            InprogresstextColor = StaticHelpers.Black2Color;
            CompletedBgColor    = StaticHelpers.GrayColor;
            CompletedtextColor  = StaticHelpers.Black2Color;
            CanceledBgColor     = StaticHelpers.GrayColor;
            CanceledtextColor   = StaticHelpers.Black2Color;

            MessagingCenter.Subscribe <List <MyBookingModel> >(this, "MyBookingListUpdate", (response) =>
            {
                AllBookingList.Clear();
                foreach (var item in response)
                {
                    var bookinglistitem = new MyBookingModel();
                    bookinglistitem     = item;

                    bookinglistitem.CategoryName              = item.Category.Name;
                    bookinglistitem.Category.Picture          = IsImagesValid(item.Category.Picture, apiImageBaseUrl: ApiHelpers.CategoryImageBaseUrl);
                    bookinglistitem.Category.Icon             = IsImagesValid(item.Category.Icon, apiImageBaseUrl: ApiHelpers.CategoryImageBaseUrl);
                    bookinglistitem.SubCategory.Picture       = IsImagesValid(item.SubCategory.Picture, apiImageBaseUrl: ApiHelpers.SubCategoryImageBaseUrl);
                    bookinglistitem.SubCategory.Icon          = IsImagesValid(item.SubCategory.Icon, apiImageBaseUrl: ApiHelpers.SubCategoryImageBaseUrl);
                    bookinglistitem.ServiceProviderProfilePic = IsImagesValid(item.ServiceProviderProfilePic, ApiHelpers.ApiImageBaseUrl);
                    bookinglistitem.ServiceProviderName       = !string.IsNullOrEmpty(item.ServiceProviderName) && !string.IsNullOrWhiteSpace(item.ServiceProviderName) ? item.ServiceProviderName : AppResource.BroomService;
                    bookinglistitem.ServiceStartDate          = item.JobStartDatetime.Value.ToString("ddd, MMMM dd, yyyy");
                    bookinglistitem.ServiceStartTime          = item.JobStartDatetime.Value.ToString("hh:mm tt");
                    bookinglistitem.ServiceStartDateTime      = item.JobStartDatetime.Value.ToString("dd/MM/yyyy") + " at " + item.JobStartDatetime.Value.ToString("hh:mm tt");
                    bookinglistitem.ServiceDetailStartDate    = item.JobStartDatetime.Value.ToString("dd/MM/yyyy");
                    bookinglistitem.ServiceEndDate            = item.JobEndDatetime.Value.ToString("ddd, MMMM dd, yyyy");
                    bookinglistitem.ServiceEndTime            = item.JobEndDatetime.Value.ToString("hh:mm tt");
                    bookinglistitem.ServiceEndDateTime        = item.JobEndDatetime.Value.ToString("dd/MM/yyyy") + " at " + item.JobEndDatetime.Value.ToString("hh:mm tt");
                    bookinglistitem.ServiceDetailEndDate      = item.JobEndDatetime.Value.ToString("dd/MM/yyyy");
                    bookinglistitem.IsNoJobStatusPending      = item.JobStatus == Convert.ToInt32(RequestStatus.Pending) ? false : true;

                    if (item.JobStatus == Convert.ToInt32(RequestStatus.Completed))
                    {
                        bookinglistitem.IsPaymentBtnVisible = true;
                        if (item.IsPaymentDone != null && item.IsPaymentDone.Value)
                        {
                            bookinglistitem.PaymentBtnText     = AppResource.PaymentBtn1;
                            bookinglistitem.PaymentBgColor     = Color.FromHex(StaticHelpers.GrayColor);
                            bookinglistitem.IsPaymentBtnEnable = false;
                        }
                        else
                        {
                            bookinglistitem.PaymentBtnText     = AppResource.PaymentBtn;
                            bookinglistitem.PaymentBgColor     = Color.FromHex(StaticHelpers.BlueColor);
                            bookinglistitem.IsPaymentBtnEnable = true;
                        }
                    }
                    else
                    {
                        bookinglistitem.IsPaymentBtnVisible = false;
                    }
                    AllBookingList.Add(bookinglistitem);
                }
                GetBookingListByStatus();
            });
        }