Example #1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            _Facade = new GroupBuyingFacade(this);
            _VM     = new GroupBuyingQueryVM();
            _Facade.GetGroupBuyingTypes((s, args) =>
            {
                if (!args.FaultsHandle())
                {
                    foreach (var gbt in args.Result)
                    {
                        _VM.GroupBuyingTypeList.Add(new KeyValuePair <int, string>(gbt.Key, gbt.Value));
                    }
                    _Facade.GetGroupBuyingAreas((s1, args1) =>
                    {
                        if (!args1.FaultsHandle())
                        {
                            foreach (var gba in args1.Result)
                            {
                                _VM.GroupBuyingAreaList.Add(new KeyValuePair <int, string>(gba.Key, gba.Value));
                            }

                            _VM.GroupBuyingTypeList.Insert(0, new KeyValuePair <int, string>(0, ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All));
                            _VM.GroupBuyingAreaList.Insert(0, new KeyValuePair <int, string>(0, ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All));
                            this.DataContext = _VM;
                            this.cmbGroupBuyingCategoryType.SelectedIndex = 0;
                            this.cmbGroupBuyingArea.SelectedIndex         = 0;
                        }
                    });
                }
            });
            this.DataContext = _VM;
        }
Example #2
0
        public void Query(GroupBuyingQueryVM vm, PagingInfo pagingInfo, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            var data = vm.ConvertVM <GroupBuyingQueryVM, GroupBuyingQueryFilter>();

            data.PagingInfo = pagingInfo;
            string relativeUrl = "/MKTService/GroupBuying/Query";

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