private async void LoadActivePromotions() { using (this.Services().Message.ShowProgress()) { ActivePromotions.Clear(); try { var activePromotions = await _promotionService.GetActivePromotions(); if (activePromotions == null) { return; } foreach (var activePromotion in activePromotions) { ActivePromotions.Add(new PromotionItemViewModel(activePromotion, SelectPromotion)); } RaisePropertyChanged(() => ActivePromotions); } catch (Exception ex) { Logger.LogMessage(ex.Message, ex.ToString()); this.Services().Message.ShowMessage(this.Services().Localize["Error"], this.Services().Localize["PromotionLoadError"]); } } }
public object Get(ActivePromotions request) { var accountId = new Guid(this.GetSession().UserAuthId); return(_promotionDao.GetUnlockedPromotionsForUser(accountId) .Select(promotionDetail => { var activePromotion = new ActivePromotion { Name = promotionDetail.Name, Description = promotionDetail.Description, Code = promotionDetail.Code, ExpirationDate = promotionDetail.GetEndDateTime() }; AddProgressToPromotion(accountId, promotionDetail, activePromotion); return activePromotion; }).ToArray()); }
public ActivePromotionDetailPage(ActivePromotions item) { InitializeComponent(); // act_promo = item; title.Text = item.name; type_val.Text = item.type; proservice_val.Text = item.product; startdate_val.Text = item.start_date; enddate_val.Text = item.end_date; // promoresult = Controller.InstanceCreation().GetSalesData(cus_id); if (item.type == "7_total_price_product_filter_by_quantity") { sevan_totalpricefilter_stack.IsVisible = true; sevan_totalListview.ItemsSource = item.type_list; one_dis_on_totorder_stack.IsVisible = false; two_dis_on_cat_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; } else if (item.type == "6_price_filter_quantity") { six_unitpricefilter_stack.IsVisible = true; six_unitpriceListview.ItemsSource = item.type_list; one_dis_on_totorder_stack.IsVisible = false; two_dis_on_cat_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else if (item.type == "5_pack_free_gift") { five_bypackfree_stack.IsVisible = true; fiveaaa_bypackfree2_stack.IsVisible = true; five_bypackfreeListview.ItemsSource = item.list1; bypackfreeListview2.ItemsSource = item.list2; five_bypackfreeListview.HeightRequest = item.list1.Count * 50; bypackfreeListview2.HeightRequest = item.list2.Count * 50; one_dis_on_totorder_stack.IsVisible = false; two_dis_on_cat_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else if (item.type == "4_pack_discount") { four_bypackdiscount_stack.IsVisible = true; fouraaa_bypackdiscount2_stack.IsVisible = true; four_bypackdiscountListview.ItemsSource = item.list1; four_bypackdiscountListview2.ItemsSource = item.list2; four_bypackdiscountListview.HeightRequest = item.list1.Count * 50; four_bypackdiscountListview2.HeightRequest = item.list2.Count * 50; one_dis_on_totorder_stack.IsVisible = false; two_dis_on_cat_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else if (item.type == "3_discount_by_quantity_of_product") { three_dis_by_quan_stack.IsVisible = true; three_dis_by_quanListview.ItemsSource = item.type_list; one_dis_on_totorder_stack.IsVisible = false; two_dis_on_cat_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else if (item.type == "2_discount_category") { two_dis_on_cat_stack.IsVisible = true; two_dis_on_catListview.ItemsSource = item.type_list; one_dis_on_totorder_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else if (item.type == "1_discount_total_order") { one_dis_on_totorder_stack.IsVisible = true; one_dis_on_totorderListview.ItemsSource = item.type_list; two_dis_on_cat_stack.IsVisible = false; three_dis_by_quan_stack.IsVisible = false; four_bypackdiscount_stack.IsVisible = false; fouraaa_bypackdiscount2_stack.IsVisible = false; five_bypackfree_stack.IsVisible = false; fiveaaa_bypackfree2_stack.IsVisible = false; six_unitpricefilter_stack.IsVisible = false; sevan_totalpricefilter_stack.IsVisible = false; } else { } var backRecognizer = new TapGestureRecognizer(); backRecognizer.Tapped += (s, e) => { PopupNavigation.PopAsync(); // Navigation.PopAllPopupAsync(); // Navigation.PushAsync(new CalendarPage()); // App.Current.MainPage = new MasterPage(new CalendarPage()); }; backImg.GestureRecognizers.Add(backRecognizer); }