private void OnTimedEvent(object obj, EventArgs e)
        {
            if (NowDateTime.AddHours(1).Date > NowDateTime.Date)
            {
                Player.EditMoney(100);
            }
            NowDateTime = NowDateTime.AddHours(1);
            DateTimeText.BeginInit();

            DateTimeText.Text = $"Date: {NowDateTime.ToShortDateString()} Time: {NowDateTime.ToShortTimeString()}";
            DateTimeText.EndInit();
        }
Beispiel #2
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;
            }