Пример #1
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;
            }
Пример #2
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;
            }