示例#1
0
        public ActionResult View(int Id, string tabName)
        {
            var resul          = _saleCampaignContract.SalesCampaigns.Where(c => c.Id == Id).FirstOrDefault();
            var originStoreId  = resul.StoresIds.Split(",", true);
            var storeIds       = originStoreId.Select(id => int.Parse(id)).ToList();
            var selectItemList = _storeContract.QueryManageStore(AuthorityHelper.OperatorId.Value)
                                 .Select(s => new SelectListItem()
            {
                Text = s.StoreName, Value = s.Id.ToString()
            })
                                 .ToList();

            selectItemList.Each(item =>
            {
                if (originStoreId.Contains(item.Value))
                {
                    item.Selected = true;
                }
            });

            ViewBag.Brand   = CacheAccess.GetBrand(_brandContract, false, false);
            ViewBag.Stores  = selectItemList;
            ViewBag.TabName = tabName;
            return(PartialView(resul));
        }
        /// <summary>
        /// 添加会员界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Create()
        {
            var enterpriseBindId = RedisCacheHelper.Get <int>(RedisCacheHelper.EnterpriseMemberTypeId);

            ViewBag.EnterpriseMemberTypeId = enterpriseBindId;

            var memberTypes = _memberTypeContract.SelectList(string.Empty);

            memberTypes.RemoveAll(m => m.Value == enterpriseBindId.ToString());
            ViewBag.MemberType = memberTypes;

            int       adminId = AuthorityHelper.OperatorId ?? 0;
            MemberDto dto     = new MemberDto();
            var       store   = _storeContract.QueryManageStore(adminId).Where(s => s.IsAttached).FirstOrDefault();

            if (store.IsNotNull())
            {
                dto.StoreId   = store.Id;
                dto.StoreName = store.StoreName;
            }
            return(PartialView(dto));
        }