Ejemplo n.º 1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            List <WebChannelVM> webChennelList = new List <WebChannelVM>();

            foreach (UIWebChannel uiChannel in CPApplication.Current.CurrentWebChannelList)
            {
                webChennelList.Add(new WebChannelVM()
                {
                    ChannelID = uiChannel.ChannelID, ChannelName = uiChannel.ChannelName
                });
            }
            lstChannel.ItemsSource = webChennelList;

            List <KeyValuePair <CountdownStatus?, string> > statusList = EnumConverter.GetKeyValuePairs <CountdownStatus>();

            statusList.Insert(0, new KeyValuePair <CountdownStatus?, string>(null, ResCommonEnum.Enum_Select));
            lstStatus.ItemsSource   = statusList;
            lstStatus.SelectedIndex = 0;

            List <KeyValuePair <int?, string> > PromotionType = new List <KeyValuePair <int?, string> >();

            PromotionType.Add(new KeyValuePair <int?, string>(null, ResCommonEnum.Enum_Select));
            // PromotionType.Add(new KeyValuePair<int?, string>(1, "促销计划"));
            //PromotionType.Add(new KeyValuePair<int?, string>(1, ResCountdownQuery.Msg_PromotionPlan));
            //PromotionType.Add(new KeyValuePair<int?, string>(0, "限时抢购"));
            PromotionType.Add(new KeyValuePair <int?, string>(0, ResCountdownQuery.Msg_Countdown));
            lstPromotionType.ItemsSource   = PromotionType;
            lstPromotionType.SelectedIndex = 0;

            #region 是否秒杀
            List <KeyValuePair <int?, string> > skList = new List <KeyValuePair <int?, string> >();
            skList.Add(new KeyValuePair <int?, string>(null, ResCommonEnum.Enum_Select));
            skList.Add(new KeyValuePair <int?, string>(1, ResCountdownQuery.RadioButton_Yes));
            skList.Add(new KeyValuePair <int?, string>(0, ResCountdownQuery.RadioButton_No));
            cbIsSecondKill.ItemsSource   = skList;
            cbIsSecondKill.SelectedIndex = 0;
            #endregion
            _Facade = new CountdownFacade(this);


            _ViewModel           = new CountdownQueryFilterVM();
            _ViewModel.ChannelID = "1";
            this.DataContext     = _ViewModel;
            base.OnPageLoad(sender, e);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="vm"></param>
        /// <param name="pagingInfo"></param>
        /// <param name="callback"></param>
        public void Query(CountdownQueryFilterVM vm, PagingInfo pagingInfo, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            var data = vm.ConvertVM <CountdownQueryFilterVM, CountdownQueryFilter>((v, filter) =>
            {
                if (v.IsGroupOn.HasValue)
                {
                    filter.IsGroupOn = vm.IsGroupOn.Value ? "Y" : "N";
                }
                else
                {
                    filter.IsGroupOn = null;
                }

                if (v.IsShowCategory.HasValue && v.IsShowCategoryAll.HasValue && !v.IsShowCategoryAll.Value)
                {
                    filter.IsC1Show = v.IsShowCategory.Value ? "Y" : "N";
                    filter.IsC2Show = v.IsShowCategory.Value ? "N" : "Y";
                }
                else
                {
                    filter.IsC1Show = null;
                    filter.IsC2Show = null;
                }
                if (v.IsHomePageShow.HasValue)
                {
                    filter.IsHomePageShow = v.IsHomePageShowVal;
                }
                if (v.IsCountDownAreaShow.HasValue)
                {
                    filter.IsCountDownAreaShow = v.IsCountDownAreaShowVal;
                }
            });

            data.PageInfo = pagingInfo;
            string relativeUrl = "/MKTService/Countdown/Query";

            restClient.QueryDynamicData(relativeUrl, data, callback);
        }