public void Bind(ICategory model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 4);

                if (CellContentRootView != null)
                {
                    CellContentRootView.Tag    = model;
                    CellContentRootView.Click -= CellContentRootView_Click;
                    CellContentRootView.Click += CellContentRootView_Click;
                }

                if (CategoryText != null)
                {
                    CategoryText.Text = model.Name.ToUpperInvariant();
                    CategoryText.SetTextColor(ColorConstants.WhiteColor);
                    CategoryText.SetBackgroundColor(ColorConstants.SelectorHome, 4);
                    CategoryText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size12);
                }

                if (CategoryImage != null)
                {
                    CategoryImage.SetImageFromResource(model.Image);
                    CategoryImage.SetBackgroundColor(ColorConstants.TransparentColor, 4);
                }
            }
            public void Bind(IOrderContent model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 5);

                CategoryImage?.SetImageFromUrl(model.ImagePath);

                if (!ItemNameText.IsNull())
                {
                    ItemNameText.Text = model.OrderName;
                    ItemNameText?.SetTextColor(ColorConstants.WhiteColor);
                    ItemNameText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!PriceText.IsNull())
                {
                    PriceText.Text = "€" + model.Price * Convert.ToInt32(model.Quantity);
                    PriceText?.SetTextColor(ColorConstants.SelectorHome);
                    PriceText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (QuantityText.IsNull())
                {
                    return;
                }
                QuantityText.Text = model.Quantity + " pcs";
                QuantityText?.SetTextColor(ColorConstants.WhiteColor);
                QuantityText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
            }
Exemple #3
0
            public void Bind(IFeedback model)
            {
                if (CellContentRootView != null)
                {
                    CellContentRootView.Tag    = new { Model = model, Text = ServiceText, Image = ServiceImage };
                    CellContentRootView.Click -= CellContentRootView_Click;
                    CellContentRootView.Click += CellContentRootView_Click;

                    CellContentRootView.SetBackgroundColor(ColorConstants.TransparentColor);
                }

                if (ServiceText != null)
                {
                    ServiceText.Text = model.Name.ToUpperInvariant();
                    ServiceText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size12);

                    if (!FeedbackManager.Instance.LastService)
                    {
                        ServiceText.SetTextColor(ColorConstants.BackgroundGray);
                    }
                    else if (!model.Selected)
                    {
                        ServiceText.SetTextColor(ColorConstants.BackgroundGray);
                    }
                    else
                    {
                        ServiceText.SetTextColor(ColorConstants.SelectorHome);
                    }
                }

                if (ServiceImage == null)
                {
                    return;
                }
                ServiceImage.SetImageFromResource(model.ImagePath);

                if (!FeedbackManager.Instance.LastService)
                {
                    ServiceImage.SetImageColorFilter(ColorConstants.BackgroundGray);
                }
                else if (!model.Selected)
                {
                    ServiceImage.SetImageColorFilter(ColorConstants.BackgroundGray);
                }
                else
                {
                    ServiceImage.SetImageColorFilter(ColorConstants.SelectorHome);
                }
            }
Exemple #4
0
            public void Bind(Models.DTO.Order.Get.OrderModel model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 5);

                if (!ItemTypeOrder.IsNull())
                {
                    ItemTypeOrder.Text = model.Type == 1 ? @ROrderBar.OrderAtBar : ROrderTable.OrderAtTable;
                    ItemTypeOrder?.SetTextColor(ColorConstants.WhiteColor);
                    ItemTypeOrder.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!PriceText.IsNull())
                {
                    PriceText.Text = "€" + model.TotalAmount;
                    PriceText?.SetTextColor(ColorConstants.SelectorHome);
                    PriceText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!OrderIdText.IsNull())
                {
                    OrderIdText.Text = "#" + model.Id;
                    OrderIdText?.SetTextColor(ColorConstants.SelectorHome);
                    OrderIdText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size36);
                }

                if (DateTimeText.IsNull())
                {
                    return;
                }
                DateTimeText.Text = model.UpdatedAt.UnixTimeStampToDateTime().ToString("dd.MM.yyyy / hh:mm");
                DateTimeText?.SetTextColor(ColorConstants.WhiteColor);
                DateTimeText?.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size14);


                if (CellContentRootView.IsNull())
                {
                    return;
                }
                CellContentRootView.Tag    = model;
                CellContentRootView.Click -= CellContentRootView_Click;
                CellContentRootView.Click += CellContentRootView_Click;
            }
Exemple #5
0
            public void Bind(IOrderContent model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 5);
                CategoryImage?.SetImageFromUrl(model.ImagePath);

                if (!RemoveOrderImage.IsNull())
                {
                    RemoveOrderImage?.SetImageFromResource(DrawableConstants.OrderRemoveIcon);

                    RemoveOrderImage.Tag = model;

                    RemoveOrderImage.Click -= RemoveOrderImage_Click;
                    RemoveOrderImage.Click += RemoveOrderImage_Click;
                }

                if (!ItemNameText.IsNull())
                {
                    ItemNameText.Text = model.OrderName;
                    ItemNameText?.SetTextColor(ColorConstants.WhiteColor);
                    ItemNameText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!PriceText.IsNull())
                {
                    PriceText.Text = "€" + model.Price * Convert.ToInt32(model.Quantity);
                    PriceText?.SetTextColor(ColorConstants.SelectorHome);
                    PriceText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!MinusText.IsNull())
                {
                    MinusText?.SetTextColor(ColorConstants.WhiteColor);
                    MinusText?.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size20);
                    MinusText?.SetBackgroundColor(ColorConstants.SelectorHome, type: RadiusType.Aspect);
                    MinusText?.SetSelectedColor(ColorConstants.SelectorHome.SelectorTransparence(ColorConstants.Procent50));
                    MinusText.Text = "-";
                    MinusText.Tag  = new { Model = model };

                    MinusText.Click -= MinusText_Click;
                    MinusText.Click += MinusText_Click;
                }

                if (!QuantityText.IsNull())
                {
                    QuantityText.Text = model.Quantity;
                    QuantityText?.SetTextColor(ColorConstants.WhiteColor);
                    QuantityText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (PlusText.IsNull())
                {
                    return;
                }
                PlusText?.SetTextColor(ColorConstants.WhiteColor);
                PlusText?.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size20);
                PlusText.Text = "+";
                PlusText?.SetBackgroundColor(ColorConstants.SelectorHome, type: RadiusType.Aspect);
                PlusText?.SetSelectedColor(ColorConstants.SelectorHome.SelectorTransparence(ColorConstants.Procent50));

                PlusText.Tag = new { Model = model };

                PlusText.Click -= PlusText_Click;
                PlusText.Click += PlusText_Click;
            }
            public void Bind(IFeedback model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.TransparentColor, 4);

                if (ServiceText != null)
                {
                    ServiceText.Text = "";
                    ServiceText.SetTextColor(ColorConstants.WhiteColor);
                    ServiceText.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size12);
                }

                if (Service2Text != null)
                {
                    Service2Text.Text = model.NameCategory;
                    Service2Text.SetTextColor(ColorConstants.WhiteColor);
                    Service2Text.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size12);
                }

                if (FeedbackStatus != null)
                {
                    FeedbackStatus.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size18);
                    FeedbackStatus.SetTextColor(ColorConstants.WhiteColor);
                }

                if (FeedbackVotes != null)
                {
                    FeedbackVotes.Text = "";
                    FeedbackVotes.SetTextColor(ColorConstants.BackgroundGray);
                    FeedbackVotes.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size12);
                }

                ServiceImage?.SetImageFromResource(model.ImagePathCategory);
                ProgressView?.SetBackgroundColor(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent20), 5);

                if (model.Rating == 0)
                {
                    ResetView();

                    FeedbackStatus.Text = RFeedback.TerribleText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(0).ImagePath);
                }
                else if (model.Rating <= 20)
                {
                    FeedbackStatus.Text = RFeedback.TerribleText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(0).ImagePath);
                    ProgressView20?.SetBackgroundColor(ColorConstants.SelectorHome, 5);

                    ProgressView20.Visibility = ViewState.Visible;
                    ProgressView40.Visibility = ViewState.Invisible;
                    ProgressView60.Visibility = ViewState.Invisible;
                    ProgressView80.Visibility = ViewState.Invisible;
                }
                else if (model.Rating <= 40)
                {
                    FeedbackStatus.Text = RFeedback.BadText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(1).ImagePath);
                    ProgressView40?.SetBackgroundColor(ColorConstants.SelectorHome, 5);

                    ProgressView40.Visibility = ViewState.Visible;
                    ProgressView20.Visibility = ViewState.Invisible;
                    ProgressView60.Visibility = ViewState.Invisible;
                    ProgressView80.Visibility = ViewState.Invisible;
                }
                else if (model.Rating <= 60)
                {
                    FeedbackStatus.Text = RFeedback.OkayText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(2).ImagePath);
                    ProgressView60?.SetBackgroundColor(ColorConstants.SelectorHome, 5);

                    ProgressView60.Visibility = ViewState.Visible;
                    ProgressView40.Visibility = ViewState.Invisible;
                    ProgressView20.Visibility = ViewState.Invisible;
                    ProgressView80.Visibility = ViewState.Invisible;
                }
                else if (model.Rating <= 80)
                {
                    FeedbackStatus.Text = RFeedback.GoodText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(3).ImagePath);
                    ProgressView80?.SetBackgroundColor(ColorConstants.SelectorHome, 5);

                    ProgressView80.Visibility = ViewState.Visible;
                    ProgressView60.Visibility = ViewState.Invisible;
                    ProgressView40.Visibility = ViewState.Invisible;
                    ProgressView20.Visibility = ViewState.Invisible;
                }
                else if (model.Rating == 100)
                {
                    FeedbackStatus.Text = RFeedback.GreatText.ToUpperInvariant();
                    ImageStatus?.SetImageFromResource(FeedbackManager.Instance.GetItem().ElementAtOrDefault(4).ImagePath);
                    ProgressView?.SetBackgroundColor(ColorConstants.SelectorHome, 5);

                    ResetView();
                }

                ImageStatus?.SetImageColorFilter(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent84));
            }