Example #1
0
        public ActionResult Add(EventModel model)
        {
            if (!string.IsNullOrWhiteSpace(model.Key) && BMAConfig.EventConfig.BMAEventList.Find(x => x.Key == model.Key.Trim().ToLower()) != null)
                ModelState.AddModelError("Key", "键已经存在");

            if (!string.IsNullOrWhiteSpace(model.Title) && BMAConfig.EventConfig.BMAEventList.Find(x => x.Title == model.Title.Trim().ToLower()) != null)
                ModelState.AddModelError("Title", "名称已经存在");

            if (ModelState.IsValid)
            {
                EventInfo eventInfo = new EventInfo()
                {
                    Key = model.Key.Trim().ToLower(),
                    Title = model.Title.Trim().ToLower(),
                    TimeType = model.TimeType,
                    TimeValue = model.TimeValue,
                    ClassName = model.ClassName,
                    Code = model.Code ?? "",
                    Enabled = model.Enabled
                };

                BMAConfig.EventConfig.BMAEventList.Add(eventInfo);
                BMAConfig.SaveEventConfig(BMAConfig.EventConfig);
                AddMallAdminLog("添加事件", "添加事件,事件为:" + model.Title);
                return PromptView("事件添加成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Example #2
0
        private void LoadStoreShipFee(int regionId)
        {
            RegionInfo regionInfo = Regions.GetRegionById(regionId);

            if (regionInfo != null)
            {
                if (regionInfo.Layer == 1)
                {
                    ViewData["provinceId"] = regionInfo.ProvinceId;
                    ViewData["cityId"]     = 0;
                }
                else
                {
                    RegionInfo parentRegionInfo = Regions.GetRegionById(regionInfo.ParentId);
                    ViewData["provinceId"] = parentRegionInfo.ProvinceId;
                    ViewData["cityId"]     = regionInfo.RegionId;
                }
            }
            else
            {
                ViewData["provinceId"] = 0;
                ViewData["cityId"]     = 0;
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
        }
Example #3
0
        public ActionResult Edit(EventModel model)
        {
            EventInfo eventInfo = null;

            if (!string.IsNullOrWhiteSpace(model.Key))
                eventInfo = BMAConfig.EventConfig.BMAEventList.Find(x => x.Key == model.Key);

            if (eventInfo == null)
                return PromptView("事件不存在");

            if (!string.IsNullOrWhiteSpace(model.Title))
            {
                EventInfo temp = BMAConfig.EventConfig.BMAEventList.Find(x => x.Title == model.Title.Trim().ToLower());
                if (temp != null && temp.Key != eventInfo.Key)
                    ModelState.AddModelError("Title", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                //eventInfo.Key = model.Key.Trim().ToLower(),
                eventInfo.Title = model.Title.Trim().ToLower();
                eventInfo.TimeType = model.TimeType;
                eventInfo.TimeValue = model.TimeValue;
                eventInfo.ClassName = model.ClassName;
                eventInfo.Code = model.Code ?? "";
                eventInfo.Enabled = model.Enabled;

                BMAConfig.SaveEventConfig(BMAConfig.EventConfig);
                AddMallAdminLog("编辑事件", "编辑事件,事件为:" + model.Title);
                return PromptView("事件编辑成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Example #4
0
        public ActionResult EditAttributeGroup(AttributeGroupModel model, int attrGroupId = -1)
        {
            AttributeGroupInfo attributeGroupInfo = AdminCategories.GetAttributeGroupById(attrGroupId);

            if (attributeGroupInfo == null)
            {
                return(PromptView("属性分组不存在"));
            }

            int attrGroupId2 = AdminCategories.GetAttributeGroupIdByCateIdAndName(attributeGroupInfo.CateId, model.AttributeGroupName);

            if (attrGroupId2 > 0 && attrGroupId2 != attrGroupId)
            {
                ModelState.AddModelError("AttributeGroupName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                attributeGroupInfo.Name         = model.AttributeGroupName;
                attributeGroupInfo.DisplayOrder = model.DisplayOrder;

                AdminCategories.UpdateAttributeGroup(attributeGroupInfo);
                AddMallAdminLog("修改属性分组", "修改属性分组,属性分组ID为:" + attrGroupId);
                return(PromptView("属性分组修改成功"));
            }

            CategoryInfo categoryInfo = AdminCategories.GetCategoryById(attributeGroupInfo.CateId);

            ViewData["cateId"]       = categoryInfo.CateId;
            ViewData["categoryName"] = categoryInfo.Name;
            ViewData["referer"]      = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #5
0
        public ActionResult Add(BannedIPModel model)
        {
            string ip = "";

            if (string.IsNullOrWhiteSpace(model.IP4))
            {
                ip = string.Format("{0}.{1}.{2}", model.IP1, model.IP2, model.IP3);
            }
            else
            {
                ip = string.Format("{0}.{1}.{2}.{3}", model.IP1, model.IP2, model.IP3, model.IP4);
            }

            if (AdminBannedIPs.GetBannedIPIdByIP(ip) > 0)
            {
                ModelState.AddModelError("IP4", "IP已经存在");
            }

            if (ModelState.IsValid)
            {
                BannedIPInfo bannedIPInfo = new BannedIPInfo()
                {
                    IP          = ip,
                    LiftBanTime = model.LiftBanTime
                };

                AdminBannedIPs.AddBannedIP(bannedIPInfo);
                AddMallAdminLog("添加禁止IP", "添加禁止IP,禁止IP为:" + ip);
                return(PromptView("禁止IP添加成功"));
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #6
0
        public ActionResult Edit(TopicModel model, int topicId = -1)
        {
            TopicInfo topicInfo = AdminTopic.AdminGetTopicById(topicId);

            if (topicInfo == null)
            {
                return(PromptView("活动专题不存在"));
            }

            if (ModelState.IsValid)
            {
                topicInfo.StartTime = model.StartTime;
                topicInfo.EndTime   = model.EndTime;
                topicInfo.Title     = model.Title;
                topicInfo.HeadHtml  = model.HeadHtml ?? "";
                topicInfo.BodyHtml  = model.BodyHtml ?? "";
                topicInfo.IsShow    = model.IsShow;

                AdminTopic.UpdateTopic(topicInfo);
                AddMallAdminLog("修改活动专题", "修改活动专题,活动专题ID为:" + topicId);
                return(PromptView("活动专题修改成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #7
0
        public ActionResult Add()
        {
            ShipCompanyModel model = new ShipCompanyModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #8
0
        public ActionResult Add()
        {
            BannedIPModel model = new BannedIPModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #9
0
        public ActionResult Edit(ShipCompanyModel model, int shipCoId = -1)
        {
            ShipCompanyInfo shipCompanyInfo = AdminShipCompanies.GetShipCompanyById(shipCoId);

            if (shipCompanyInfo == null)
            {
                return(PromptView("配送公司不存在"));
            }

            int shipCoId2 = AdminShipCompanies.GetShipCoIdByName(model.CompanyName);

            if (shipCoId2 > 0 && shipCoId2 != shipCoId)
            {
                ModelState.AddModelError("CompanyName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                shipCompanyInfo.DisplayOrder = model.DisplayOrder;
                shipCompanyInfo.Name         = model.CompanyName;

                AdminShipCompanies.UpdateShipCompany(shipCompanyInfo);
                AddMallAdminLog("修改配送公司", "修改配送公司,配送公司ID为:" + shipCoId);
                return(PromptView("配送公司修改成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #10
0
        public ActionResult EditAttributeValue(int attrValueId = -1)
        {
            AttributeValueInfo attributeValueInfo = AdminCategories.GetAttributeValueById(attrValueId);

            if (attributeValueInfo == null)
            {
                return(PromptView("属性值不存在"));
            }
            if (attributeValueInfo.IsInput == 1)
            {
                return(PromptView("输入型属性值不能修改"));
            }

            AttributeValueModel model = new AttributeValueModel();

            model.AttrValue    = attributeValueInfo.AttrValue;
            model.DisplayOrder = attributeValueInfo.AttrValueDisplayOrder;

            AttributeInfo attributeInfo = Categories.GetAttributeById(attributeValueInfo.AttrId);

            ViewData["attrId"]        = attributeInfo.AttrId;
            ViewData["attributeName"] = attributeInfo.Name;
            ViewData["referer"]       = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #11
0
        public ActionResult EditAttribute(int attrId = -1)
        {
            AttributeInfo attributeInfo = AdminCategories.GetAttributeById(attrId);

            if (attributeInfo == null)
            {
                return(PromptView("属性不存在"));
            }

            AttributeModel model = new AttributeModel();

            model.AttributName = attributeInfo.Name;
            model.AttrGroupId  = attributeInfo.AttrGroupId;
            model.ShowType     = attributeInfo.ShowType;
            model.IsFilter     = attributeInfo.IsFilter;
            model.DisplayOrder = attributeInfo.DisplayOrder;

            CategoryInfo categoryInfo = AdminCategories.GetCategoryById(attributeInfo.CateId);

            ViewData["cateId"]             = categoryInfo.CateId;
            ViewData["categoryName"]       = categoryInfo.Name;
            ViewData["attributeGroupList"] = GetAttributeGroupSelectList(categoryInfo.CateId);
            ViewData["referer"]            = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #12
0
        public ActionResult AddStore()
        {
            AddStoreModel model = new AddStoreModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #13
0
        public ActionResult AddAttributeGroup(AttributeGroupModel model, int cateId = -1)
        {
            CategoryInfo categoryInfo = AdminCategories.GetCategoryById(cateId);

            if (categoryInfo == null)
            {
                return(PromptView("分类不存在"));
            }

            if (AdminCategories.GetAttributeGroupIdByCateIdAndName(cateId, model.AttributeGroupName) > 0)
            {
                ModelState.AddModelError("AttributeGroupName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                AttributeGroupInfo attributeGroupInfo = new AttributeGroupInfo()
                {
                    Name         = model.AttributeGroupName,
                    CateId       = categoryInfo.CateId,
                    DisplayOrder = model.DisplayOrder
                };

                AdminCategories.CreateAttributeGroup(attributeGroupInfo);
                AddMallAdminLog("添加属性分组", "添加属性分组,属性分组为:" + model.AttributeGroupName);
                return(PromptView("属性分组添加成功"));
            }
            ViewData["cateId"]       = categoryInfo.CateId;
            ViewData["categoryName"] = categoryInfo.Name;
            ViewData["referer"]      = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #14
0
        public ActionResult AddAttribute()
        {
            AttributeModel model = new AttributeModel();

            ViewData["attributeGroupList"] = GetAttributeGroupSelectList();
            ViewData["referer"]            = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #15
0
        public ActionResult EditProduct(EditProductModel model, int pid = -1)
        {
            ProductInfo productInfo = AdminProducts.AdminGetProductById(pid);

            if (productInfo == null)
            {
                return(PromptView("商品不存在"));
            }

            int pid2 = AdminProducts.AdminGetProductIdByName(model.ProductName);

            if (pid2 > 0 && pid2 != pid)
            {
                ModelState.AddModelError("ProductName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                productInfo.PSN          = model.PSN ?? "";
                productInfo.BrandId      = model.BrandId;
                productInfo.StoreCid     = model.StoreCid;
                productInfo.StoreSTid    = model.StoreSTid;
                productInfo.Name         = model.ProductName;
                productInfo.ShopPrice    = model.ShopPrice;
                productInfo.MarketPrice  = model.MarketPrice;
                productInfo.CostPrice    = model.CostPrice;
                productInfo.State        = model.State;
                productInfo.IsBest       = model.IsBest == true ? 1 : 0;
                productInfo.IsHot        = model.IsHot == true ? 1 : 0;
                productInfo.IsNew        = model.IsNew == true ? 1 : 0;
                productInfo.DisplayOrder = model.DisplayOrder;
                productInfo.Weight       = model.Weight;
                productInfo.Description  = model.Description ?? "";
                productInfo.Spec         = model.Spec ?? "";

                AdminProducts.UpdateProduct(productInfo, model.StockNumber, model.StockLimit);
                AddMallAdminLog("修改商品", "修改商品,商品ID为:" + pid);
                return(PromptView("商品修改成功"));
            }


            //商品属性列表
            List <ProductAttributeInfo> productAttributeList = Products.GetProductAttributeList(pid);

            //商品sku项列表
            DataTable productSKUItemList = AdminProducts.GetProductSKUItemList(productInfo.Pid);

            ViewData["pid"]                  = productInfo.Pid;
            ViewData["storeId"]              = productInfo.StoreId;
            ViewData["storeName"]            = AdminStores.GetStoreById(productInfo.StoreId).Name;
            ViewData["cateId"]               = productInfo.CateId;
            ViewData["categoryName"]         = AdminCategories.GetCategoryById(productInfo.CateId).Name;
            ViewData["productAttributeList"] = productAttributeList;
            ViewData["productSKUItemList"]   = productSKUItemList;
            ViewData["referer"]              = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #16
0
        /// <summary>
        /// 在线用户趋势
        /// </summary>
        /// <returns></returns>
        public ActionResult OnlineUserTrend()
        {
            OnlineUserTrendModel model = new OnlineUserTrendModel();

            model.PVStatList    = PVStats.GetTodayHourPVStatList();
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #17
0
        public ActionResult AddStore(AddStoreModel model)
        {
            if (AdminStores.GetStoreIdByName(model.StoreName) > 0)
            {
                ModelState.AddModelError("StoreName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                StoreInfo storeInfo = new StoreInfo()
                {
                    State        = (int)StoreState.Open,
                    Name         = model.StoreName,
                    RegionId     = 0,
                    StoreRid     = AdminStoreRanks.GetLowestStoreRank().StoreRid,
                    StoreIid     = 0,
                    Logo         = "",
                    CreateTime   = DateTime.Now,
                    Mobile       = "",
                    Phone        = "",
                    QQ           = "",
                    WW           = "",
                    DePoint      = 10.00m,
                    SePoint      = 10.00m,
                    ShPoint      = 10.00m,
                    Honesties    = 0,
                    StateEndTime = model.StateEndTime,
                    Theme        = "Default",
                    Banner       = "",
                    Announcement = "",
                    Description  = ""
                };

                StoreKeeperInfo storeKeeperInfo = new StoreKeeperInfo()
                {
                    Type    = model.Type,
                    Name    = model.StoreKeeperName,
                    IdCard  = model.IdCard,
                    Address = model.Address
                };

                int storeId = AdminStores.CreateStore(storeInfo, storeKeeperInfo);
                if (storeId > 0)
                {
                    AddMallAdminLog("添加店铺", "添加店铺,店铺id为:" + storeId);
                    return(PromptView("店铺添加成功"));
                }
                else
                {
                    return(PromptView("店铺添加失败"));
                }
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #18
0
        /// <summary>
        /// 执行事件
        /// </summary>
        public ActionResult Execute(string key = "")
        {
            EventInfo eventInfo = BMAConfig.EventConfig.BMAEventList.Find(x => x.Key == key);
            if (eventInfo == null)
                return PromptView("事件不存在");

            BMAEvent.Execute(eventInfo.Key);

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return PromptView("事件执行成功");
        }
Example #19
0
        public ActionResult EditProduct(int pid = -1)
        {
            ProductInfo productInfo = AdminProducts.AdminGetProductById(pid);

            if (productInfo == null)
            {
                return(PromptView("商品不存在"));
            }

            EditProductModel model = new EditProductModel();

            model.PSN          = productInfo.PSN;
            model.BrandId      = productInfo.BrandId;
            model.StoreCid     = productInfo.StoreCid;
            model.StoreSTid    = productInfo.StoreSTid;
            model.ProductName  = productInfo.Name;
            model.ShopPrice    = productInfo.ShopPrice;
            model.MarketPrice  = productInfo.MarketPrice;
            model.CostPrice    = productInfo.CostPrice;
            model.State        = productInfo.State;
            model.IsBest       = productInfo.IsBest == 1 ? true : false;
            model.IsHot        = productInfo.IsHot == 1 ? true : false;
            model.IsNew        = productInfo.IsNew == 1 ? true : false;
            model.DisplayOrder = productInfo.DisplayOrder;
            model.Weight       = productInfo.Weight;
            model.Description  = productInfo.Description;

            model.BrandName = AdminBrands.GetBrandById(productInfo.BrandId).Name;


            //库存信息
            ProductStockInfo productStockInfo = AdminProducts.GetProductStockByPid(pid);

            model.StockNumber = productStockInfo.Number;
            model.StockLimit  = productStockInfo.Limit;

            //商品属性列表
            List <ProductAttributeInfo> productAttributeList = Products.GetProductAttributeList(pid);

            //商品sku项列表
            DataTable productSKUItemList = AdminProducts.GetProductSKUItemList(productInfo.Pid);

            ViewData["pid"]                  = productInfo.Pid;
            ViewData["storeId"]              = productInfo.StoreId;
            ViewData["storeName"]            = AdminStores.GetStoreById(productInfo.StoreId).Name;
            ViewData["cateId"]               = productInfo.CateId;
            ViewData["categoryName"]         = AdminCategories.GetCategoryById(productInfo.CateId).Name;
            ViewData["productAttributeList"] = productAttributeList;
            ViewData["productSKUItemList"]   = productSKUItemList;
            ViewData["referer"]              = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #20
0
        public ActionResult SendCoupon(SendCouponModel model, int couponTypeId = -1)
        {
            CouponTypeInfo couponTypeInfo = AdminCoupons.AdminGetCouponTypeById(couponTypeId);

            if (couponTypeInfo == null)
            {
                return(PromptView("优惠劵类型不存在"));
            }
            if (couponTypeInfo.SendMode != 1)
            {
                return(PromptView("此优惠劵类型不能手动发放"));
            }

            //发放数量
            int sendCount = Coupons.GetSendCouponCount(couponTypeId);
            //剩余数量
            int surplusCount = couponTypeInfo.Count - sendCount;

            //判断是否大于剩余数量
            if (model.Count > surplusCount)
            {
                ModelState.AddModelError("Count", "数量不能大于" + surplusCount + "!");
            }


            if (ModelState.IsValid)
            {
                if (model.UType == 0)
                {
                    int uid = TypeHelper.StringToInt(model.UValue);
                    AdminCoupons.AdminSendCouponToUser(uid, couponTypeId, couponTypeInfo.StoreId, couponTypeInfo.Money, model.Count, WorkContext.Uid, DateTime.Now, WorkContext.IP);
                    AddMallAdminLog("按用户id发放优惠劵", string.Format("用户id:{0},优惠劵类型id:{1},名称:{2},发放数量:{3}", model.UValue, couponTypeId, couponTypeInfo.Name, model.Count));
                }
                else if (model.UType == 1)
                {
                    int uid = Users.GetUidByAccountName(model.UValue);
                    AdminCoupons.AdminSendCouponToUser(uid, couponTypeId, couponTypeInfo.StoreId, couponTypeInfo.Money, model.Count, WorkContext.Uid, DateTime.Now, WorkContext.IP);
                    AddMallAdminLog("按账户名发放优惠劵", string.Format("账户名:{0},优惠劵类型id:{1},名称:{2},发放数量:{3}", model.UValue, couponTypeId, couponTypeInfo.Name, model.Count));
                }
                else
                {
                    AdminCoupons.AdminBatchGenerateCoupon(couponTypeId, couponTypeInfo.StoreId, couponTypeInfo.Money, model.Count, WorkContext.Uid, DateTime.Now, WorkContext.IP);
                    AddMallAdminLog("批量生成优惠劵", string.Format("优惠劵类型id:{0},名称:{1},生成数量:{2}", couponTypeId, couponTypeInfo.Name, model.Count));
                }

                return(PromptView("优惠劵发放成功"));
            }

            ViewData["surplusCount"] = couponTypeInfo.Count - Coupons.GetSendCouponCount(couponTypeId);
            ViewData["referer"]      = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #21
0
        public ActionResult AddAttributeGroup(int cateId = -1)
        {
            //CategoryInfo categoryInfo = AdminCategories.GetCategoryById(cateId);
            //if (categoryInfo == null)
            //    return PromptView("分类不存在");

            AttributeGroupModel model = new AttributeGroupModel();

            //ViewData["cateId"] = categoryInfo.CateId;
            //ViewData["categoryName"] = categoryInfo.Name;
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #22
0
        public ActionResult AddSKU()
        {
            AddSKUModel model = new AddSKUModel();

            string backUrl = MallUtils.GetMallAdminRefererCookie();

            if (backUrl.Length == 0 || backUrl == "/MallAdmin/home/mallruninfo")
            {
                backUrl = Url.Action("onsaleproductlist");
                MallUtils.SetAdminRefererCookie(backUrl);
            }
            ViewData["referer"] = backUrl;
            return(View(model));
        }
Example #23
0
        private void Load()
        {
            string allowImgType = string.Empty;

            string[] imgTypeList = StringHelper.SplitString(BMAConfig.MallConfig.UploadImgType, ",");
            foreach (string imgType in imgTypeList)
            {
                allowImgType += string.Format("*{0};", imgType.ToLower());
            }

            ViewData["allowImgType"] = allowImgType;
            ViewData["maxImgSize"]   = BMAConfig.MallConfig.UploadImgSize;
            ViewData["referer"]      = MallUtils.GetMallAdminRefererCookie();
        }
Example #24
0
        private void Load(int regionId)
        {
            List <SelectListItem> userRankList = new List <SelectListItem>();

            userRankList.Add(new SelectListItem()
            {
                Text = "选择会员等级", Value = "0"
            });
            foreach (UserRankInfo info in AdminUserRanks.GetUserRankList())
            {
                userRankList.Add(new SelectListItem()
                {
                    Text = info.Title, Value = info.UserRid.ToString()
                });
            }
            ViewData["userRankList"] = userRankList;


            List <SelectListItem> mallAdminGroupList = new List <SelectListItem>();

            mallAdminGroupList.Add(new SelectListItem()
            {
                Text = "选择管理员组", Value = "0"
            });
            foreach (MallAdminGroupInfo info in MallAdminGroups.GetMallAdminGroupList())
            {
                mallAdminGroupList.Add(new SelectListItem()
                {
                    Text = info.Title, Value = info.MallAGid.ToString()
                });
            }
            ViewData["mallAdminGroupList"] = mallAdminGroupList;

            RegionInfo regionInfo = Regions.GetRegionById(regionId);

            if (regionInfo != null)
            {
                ViewData["provinceId"] = regionInfo.ProvinceId;
                ViewData["cityId"]     = regionInfo.CityId;
                ViewData["countyId"]   = regionInfo.RegionId;
            }
            else
            {
                ViewData["provinceId"] = -1;
                ViewData["cityId"]     = -1;
                ViewData["countyId"]   = -1;
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
        }
Example #25
0
        public ActionResult AddStoreShipTemplate(int storeId = -1)
        {
            StoreInfo storeInfo = AdminStores.GetStoreById(storeId);

            if (storeInfo == null)
            {
                return(PromptView("店铺不存在"));
            }

            AddStoreShipTemplateModel model = new AddStoreShipTemplateModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #26
0
        private void LoadCouponType()
        {
            List <SelectListItem> userRankList = new List <SelectListItem>();

            foreach (UserRankInfo userRankInfo in AdminUserRanks.GetCustomerUserRankList())
            {
                userRankList.Add(new SelectListItem()
                {
                    Text = userRankInfo.Title, Value = userRankInfo.UserRid.ToString()
                });
            }
            ViewData["userRankList"] = userRankList;

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
        }
Example #27
0
        public ActionResult AddAttributeValue(int attrId = -1)
        {
            AttributeInfo attributeInfo = AdminCategories.GetAttributeById(attrId);

            if (attributeInfo == null)
            {
                return(PromptView("属性不存在"));
            }

            AttributeValueModel model = new AttributeValueModel();

            ViewData["attrId"]        = attributeInfo.AttrId;
            ViewData["attributeName"] = attributeInfo.Name;
            ViewData["referer"]       = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #28
0
        public ActionResult EditNewsType(int newsTypeId = -1)
        {
            NewsTypeInfo newsTypeInfo = AdminNews.GetNewsTypeById(newsTypeId);

            if (newsTypeInfo == null)
            {
                return(PromptView("新闻类型不存在"));
            }

            NewsTypeModel model = new NewsTypeModel();

            model.NewsTypeName  = newsTypeInfo.Name;
            model.DisplayOrder  = newsTypeInfo.DisplayOrder;
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Example #29
0
        /// <summary>
        /// 订单售后服务信息
        /// </summary>
        /// <param name="asId">售后服务id</param>
        /// <returns></returns>
        public ActionResult OrderAfterServiceInfo(int asId)
        {
            OrderAfterServiceInfo orderAfterServiceInfo = AdminOrderAfterServices.GetOrderAfterServiceByASId(asId);

            if (orderAfterServiceInfo == null || orderAfterServiceInfo.StoreId != WorkContext.StoreId)
            {
                return(PromptView("订单售后服务不存在"));
            }

            OrderAfterServiceModel model = new OrderAfterServiceModel();

            model.OrderAfterServiceInfo = orderAfterServiceInfo;
            model.RegionInfo            = Regions.GetRegionById(orderAfterServiceInfo.RegionId);

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Example #30
0
        public ActionResult EditHelpCategory(int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);

            if (helpInfo == null)
            {
                return(PromptView("帮助分类不存在"));
            }

            HelpCategoryModel model = new HelpCategoryModel();

            model.HelpCategoryTitle = helpInfo.Title;
            model.DisplayOrder      = helpInfo.DisplayOrder;
            ViewData["referer"]     = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }