예제 #1
0
        public ActionResult Intro()
        {
            DBC.WeChat.Models.Infrastructures.Store StoreModel = GetStore();

            var banQuery = new BannerPictureQuery
            {
                StoreIDs     = new long[] { OwnerID },
                PictureTypes = new int[] { (int)StorePicType.IntroPicture }
            };

            var banModel = svc.SelectOrEmpty(banQuery);

            if (StoreModel == null)
            {
                StoreModel = new WeChat.Models.Infrastructures.Store();
            }

            if (banModel != null && banModel.Any())
            {
                Collection <BannerPicture> bCollection = new Collection <BannerPicture>();
                foreach (var item in banModel.ToList())
                {
                    item.Path = Path.Combine(ftp, item.Path, item.Name);
                    bCollection.Add(item);
                }

                StoreModel.BannerPictures = bCollection;
            }

            return(View(StoreModel));
        }
예제 #2
0
        public ActionResult Index()
        {
            var model = svc.SelectOrEmpty(new StoreQuery()
            {
                IDs = new long[] { OwnerID }
            }).FirstOrDefault();

            var banQuery = new BannerPictureQuery
            {
                StoreIDs     = new long[] { OwnerID },
                PictureTypes = new int[] { (int)StorePicType.BannerPicture }
            };

            var banModel = svc.SelectOrEmpty(banQuery);

            if (banModel != null && banModel.Any())
            {
                if (model != null)
                {
                    Collection <BannerPicture> bCollection = new Collection <BannerPicture>();
                    foreach (var item in banModel.ToList())
                    {
                        item.Path = Path.Combine(ftp, item.Path, item.Name);
                        bCollection.Add(item);
                    }

                    model.BannerPictures = bCollection;
                }
                else
                {
                    model = new WeChat.Models.Infrastructures.Store();
                }
            }

            var vm = new StoreVM()
            {
                BannerPictures = model.BannerPictures,
                Announcement   = model.Announcement ?? "",
                StoreName      = model.Name
            };

            return(View(vm));
        }