private void OrderList_ItemAppearing(object sender, ItemVisibilityEventArgs e) { bool isLoad = true; Task.Run(async() => { if ((((OrderInfo)e.Item).EBayUserID == dashbordMW.Product[dashbordMW.Product.Count - 21].EBayUserID || ((OrderInfo)e.Item).EBayUserID == dashbordMW.Product[dashbordMW.Product.Count - 11].EBayUserID) && dashbordMW.Product.Count >= 40) { if (dashbordMW.managerVazoo.orderInfos.Count - 40 <= dashbordMW.Product.Count) { await Task.Run(() => dashbordMW.GetOrder(false)); } Device.StartTimer(TimeSpan.FromSeconds(1), () => { int countPageAddP = (dashbordMW.Product.Count / 10); int pageOrMV = dashbordMW.managerVazoo.orderInfos.Count / 10; int pageP = dashbordMW.Product.Count / 10; int remainderOrMV = pageOrMV == pageP ? dashbordMW.managerVazoo.orderInfos.Count % 10 : 0; if (dashbordMW.managerVazoo.orderInfos.Count != dashbordMW.Product.Count) { for (int i = (countPageAddP * 10); i < (countPageAddP * 10 + (remainderOrMV == 0 ? 10 : remainderOrMV)); i++) { dashbordMW.Product.Add(dashbordMW.managerVazoo.orderInfos[i]); } } return(false); }); } }); }
private async void RadioButton_Clicked(object sender, EventArgs e) { dashbordMW.countPage = 0; var inp = ((CrossAddRadiobtn)sender); int idInp = inp.Idi; if (dashbordMW.Type != idInp) { await PopupNavigation.PopAsync(true); dashbordMW.Type = idInp; int stateAuth = 0; await Task.Run(async() => { stateAuth = await dashbordMW.GetOrder(true); }); if (stateAuth == 3) { dashbordMW.SelectProduct = new List <Models.OrderInfo>(); dashbordMW.CountSelectOrder = ""; if (dashbordMW.Type == 1) { dashbordMW.Title = $"Paid {dashbordMW.countOrder}"; dashbordMW.TypeCheck = true; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = false; dashbordMW.menuDetalePage.CheckAndSetCountDashbord(dashbordMW.countOrder); } else if (dashbordMW.Type == 2) { dashbordMW.Title = $"Sold Last 3 month {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = true; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = false; } else if (dashbordMW.Type == 3) { dashbordMW.Title = $"Labels Printed Last 72h {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = true; dashbordMW.TypeCheck3 = false; } else if (dashbordMW.Type == 4) { dashbordMW.Title = $"Printing label error {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = true; } } else if (stateAuth == 2) { await PopupNavigation.PushAsync(new Error("Error"), true); } else if (stateAuth == 1) { await PopupNavigation.PushAsync(new Error("No network"), true); } else if (stateAuth == 4) { await PopupNavigation.PushAsync(new Error("Technical works on the server"), true); } } }