Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public ActionResult AddStore()
 {
     AddStoreModel model = new AddStoreModel();
     ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
     return View(model);
 }