Exemplo n.º 1
0
        protected override void OnReady()
        {
            int shopId = this.Shop;

            var q = (ShopService.Query(new ShopRequest() { State = ShopStates.Normal }).ToList().Select(x => new IdNamePair { Key = x.ShopId, Name = x.FormatedName })).ToList();
            q.Insert(0, new IdNamePair { Key = Ecard.Models.Shop.Default.ShopId, Name = Ecard.Models.Shop.Default.FormatedName });
            this.Shop.Bind(q, true);

            SetParameter("ShopId", shopId == Globals.All ? null : (int?)shopId);
            SetParameter("Start", Start);
            SetParameter("End", End == null ? null : (DateTime?)End.Value.Date.AddDays(1));
            SetParameter("accountShopId", (int)this.AccountShop == Globals.All ? null : (int?)this.AccountShop);
            q = (from x in ShopService.Query(new ShopRequest() { State = ShopStates.Normal, IsBuildIn = false })
                 select new IdNamePair { Key = x.ShopId, Name = x.FormatedName }).ToList();
            q.Insert(0, new IdNamePair { Key = Ecard.Models.Shop.Default.ShopId, Name = Ecard.Models.Shop.Default.FormatedName });
            AccountShop.Bind(q, true);
        }
Exemplo n.º 2
0
        protected override void OnReady()
        {
            SetParameter("DayMin", DayMin);
            SetParameter("DayMax", DayMax);
            SetParameter("AccountName", string.IsNullOrEmpty(AccountName) ? null : AccountName);
            SetParameter("accountShopId", (int)this.AccountShop == Globals.All ? null : (int?)this.AccountShop);
            var q = (from x in ShopService.Query(new ShopRequest()
            {
                State = ShopStates.Normal, IsBuildIn = false
            })
                     select new IdNamePair {
                Key = x.ShopId, Name = x.FormatedName
            }).ToList();

            q.Insert(0, new IdNamePair {
                Key = Ecard.Models.Shop.Default.ShopId, Name = Ecard.Models.Shop.Default.FormatedName
            });
            AccountShop.Bind(q, true);
        }