Example #1
0
        public ActionResult EditStore(StoreModel model)
        {
            int storeId = AdminStores.GetStoreIdByName(model.StoreName);
            if (storeId > 0 && storeId != WorkContext.StoreId)
                ModelState.AddModelError("StoreName", "店铺名已经存在");

            if (ModelState.IsValid)
            {
                WorkContext.StoreInfo.Name = model.StoreName;
                WorkContext.StoreInfo.RegionId = model.RegionId;
                WorkContext.StoreInfo.StoreIid = model.StoreIid;
                WorkContext.StoreInfo.Logo = model.Logo == null ? "" : model.Logo;
                WorkContext.StoreInfo.Mobile = model.Mobile == null ? "" : model.Mobile;
                WorkContext.StoreInfo.Phone = model.Phone == null ? "" : model.Phone;
                WorkContext.StoreInfo.QQ = model.QQ == null ? "" : model.QQ;
                WorkContext.StoreInfo.WW = model.WW == null ? "" : model.WW;
                WorkContext.StoreInfo.Theme = model.Theme;
                WorkContext.StoreInfo.Banner = model.Banner == null ? "" : model.Banner;
                WorkContext.StoreInfo.Announcement = model.Announcement == null ? "" : model.Announcement;
                WorkContext.StoreInfo.Description = model.Description == null ? "" : model.Description;

                AdminStores.UpdateStore(WorkContext.StoreInfo);
                AddStoreAdminLog("修改店铺", "修改店铺");
                return PromptView(Url.Action("editstore"), "店铺修改成功");
            }

            LoadStore(model.RegionId);
            return View(model);
        }
Example #2
0
        public ActionResult EditStore()
        {
            StoreModel model = new StoreModel();

            model.StoreName = WorkContext.StoreInfo.Name;
            model.RegionId = WorkContext.StoreInfo.RegionId;
            model.StoreIid = WorkContext.StoreInfo.StoreIid;
            model.Logo = WorkContext.StoreInfo.Logo;
            model.Mobile = WorkContext.StoreInfo.Mobile;
            model.Phone = WorkContext.StoreInfo.Phone;
            model.QQ = WorkContext.StoreInfo.QQ;
            model.WW = WorkContext.StoreInfo.WW;
            model.Theme = WorkContext.StoreInfo.Theme;
            model.Banner = WorkContext.StoreInfo.Banner;
            model.Announcement = WorkContext.StoreInfo.Announcement;
            model.Description = WorkContext.StoreInfo.Description;

            LoadStore(model.RegionId);
            return View(model);
        }