예제 #1
0
        /// <summary>
        /// 个人入驻商家信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Steps1()
        {
            long   CompanyRegionId         = 0;
            long   BusinessLicenceRegionId = 0;
            string RefuseReason            = "";
            var    step1 = ShopApplication.GetShopProfileSteps1(CurrentSellerManager.ShopId, out CompanyRegionId, out BusinessLicenceRegionId, out RefuseReason);

            ViewBag.CompanyRegionIds         = RegionApplication.GetRegionPath((int)CompanyRegionId);
            ViewBag.BusinessLicenceRegionIds = RegionApplication.GetRegionPath((int)BusinessLicenceRegionId);
            ViewBag.RefuseReason             = RefuseReason;

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var model = MemberApplication.GetMembers(uid);

            step1.RealName = model.RealName;
            Mall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            step1.MemberEmail = mMemberAccountSafety.Email;
            step1.MemberPhone = mMemberAccountSafety.Phone;

            //温馨提示
            ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
            ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
            return(View(step1));
        }
예제 #2
0
        public ActionResult EditShippingAddress(long addressId = 0L, string returnURL = "")
        {
            ShippingAddressInfo userAddress = OrderApplication.GetUserAddress(addressId);

            ViewBag.addId = addressId;
            if (userAddress != null)
            {
                ViewBag.fullPath = RegionApplication.GetRegionPath(userAddress.RegionId);
                ViewBag.fullName = RegionApplication.GetFullName(userAddress.RegionId, " ");
            }
            return(base.View(userAddress));
        }
예제 #3
0
        /// <summary>
        /// 获得编辑收获地址页面
        /// </summary>
        /// <param name="addressId">收货地址Id</param>
        /// <param name="returnURL">返回url路径</param>
        public ActionResult EditShippingAddress(long addressId = 0, string returnURL = "")
        {
            var ShipngInfo = OrderApplication.GetUserAddress(addressId);

            ViewBag.addId = addressId;
            if (ShipngInfo != null)
            {
                ViewBag.fullPath = RegionApplication.GetRegionPath(ShipngInfo.RegionId);
                ViewBag.fullName = RegionApplication.GetFullName(ShipngInfo.RegionId);
            }
            return(View(ShipngInfo));
        }
예제 #4
0
        public ActionResult Step2()
        {
            Entities.ShopInfo.ShopStage Stage = Entities.ShopInfo.ShopStage.Agreement;
            var shop = ShopApplication.GetShopProfileStep2(CurrentSellerManager.ShopId, out Stage);

            if (Stage == Entities.ShopInfo.ShopStage.CompanyInfo)
            {
                return(RedirectToAction("step1"));
            }

            ViewBag.BankRegionIds = RegionApplication.GetRegionPath(shop.BankRegionId);


            return(View(shop));
        }
예제 #5
0
        /// <summary>
        /// 获得编辑收获地址页面
        /// </summary>
        /// <param name="addressId">收货地址Id</param>
        /// <param name="returnURL">返回url路径</param>
        public ActionResult EditShippingAddress(long addressId = 0, string returnURL = "")
        {
            var ShipngInfo = OrderApplication.GetUserAddress(addressId);

            ViewBag.addId = addressId;
            if (ShipngInfo != null)
            {
                ViewBag.fullPath = RegionApplication.GetRegionPath(ShipngInfo.RegionId);
                ViewBag.fullName = RegionApplication.GetFullName(ShipngInfo.RegionId);
            }
            #region 是否开启门店授权
            ViewBag.IsOpenStore = SiteSettingApplication.SiteSettings != null && SiteSettingApplication.SiteSettings.IsOpenStore;
            #endregion
            return(View(ShipngInfo));
        }
예제 #6
0
        /// <summary>
        /// 银行账户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Step4()
        {
            Cache.Remove(CacheKeyCollection.CACHE_SHOP(CurrentSellerManager.ShopId, false));
            ShopInfo.ShopStage Stage = ShopInfo.ShopStage.Agreement;
            var shop = ShopApplication.GetShopProfileStep2(CurrentSellerManager.ShopId, out Stage);

            if (Stage == ShopInfo.ShopStage.CompanyInfo)
            {
                return(RedirectToAction("step3"));
            }

            ViewBag.BankRegionIds = RegionApplication.GetRegionPath(shop.BankRegionId);
            ViewBag.fullName      = RegionApplication.GetFullName(shop.BankRegionId);

            return(View(shop));
        }
예제 #7
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="query"></param>
        /// <param name="rows"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public JsonResult List(ShopBranchQuery query, int rows, int page)
        {
            query.PageNo   = page;
            query.PageSize = rows;
            if (query.AddressId.HasValue)
            {
                query.AddressPath = RegionApplication.GetRegionPath(query.AddressId.Value);
            }
            QueryPageModel <ShopBranch> shopBranchs = ShopBranchApplication.GetShopBranchs(query);

            return(this.Json((object)new DataGridModel <ShopBranch>()
            {
                rows = (IEnumerable <ShopBranch>)shopBranchs.Models,
                total = shopBranchs.Total
            }));
        }
예제 #8
0
        public JsonResult List(ShopBranchQuery query)
        {
            query.ShopId = (int)CurrentSellerManager.ShopId;
            if (query.AddressId.HasValue)
            {
                query.AddressPath = RegionApplication.GetRegionPath(query.AddressId.Value);
            }
            var shopBranchs = ShopBranchApplication.GetShopBranchs(query);
            var dataGrid    = new DataGridModel <ShopBranch>()
            {
                rows  = shopBranchs.Models,
                total = shopBranchs.Total
            };

            return(Json(dataGrid));
        }
예제 #9
0
        /// <summary>
        /// 个人或企业账户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Step3()
        {
            var modelShop = ShopApplication.GetShop(CurrentSellerManager.ShopId);

            #region 个人/企业信息
            long   companyRegionId         = 0;
            long   businessLicenceRegionId = 0;
            string refuseReason            = "";
            if (modelShop.BusinessType.Equals(Himall.CommonModel.ShopBusinessType.Personal))
            {
                var step1 = ShopApplication.GetShopProfileSteps1(CurrentSellerManager.ShopId, out companyRegionId, out businessLicenceRegionId, out refuseReason);
                ViewBag.CompanyRegionIds = RegionApplication.GetRegionPath((int)companyRegionId);
                ViewBag.RefuseReason     = refuseReason;
                ViewBag.fullName         = RegionApplication.GetFullName((int)companyRegionId);

                long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
                var  model = MemberApplication.GetMembers(uid);
                step1.RealName = model.RealName;
                Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
                step1.MemberEmail = mMemberAccountSafety.Email;
                step1.MemberPhone = mMemberAccountSafety.Phone;

                ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
                ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
                return(View("Steps3", step1));
            }
            else
            {
                var step1 = ShopApplication.GetShopProfileStep1(CurrentSellerManager.ShopId, out companyRegionId, out businessLicenceRegionId, out refuseReason);
                ViewBag.CompanyRegionIds = RegionApplication.GetRegionPath((int)companyRegionId);
                ViewBag.RefuseReason     = refuseReason;
                ViewBag.fullName         = RegionApplication.GetFullName((int)companyRegionId);

                long uid   = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
                var  model = MemberApplication.GetMembers(uid);
                step1.RealName = model.RealName;
                Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
                step1.MemberEmail = mMemberAccountSafety.Email;
                step1.MemberPhone = mMemberAccountSafety.Phone;

                ModelState.AddModelError("Phone", "多个联系方式用,号分隔");
                ModelState.AddModelError("ContactPhone", "多个联系方式用,号分隔");
                return(View(step1));
            }
            #endregion
        }
예제 #10
0
        public ActionResult EditShippingAddress(long addressId = 0L, string returnURL = "", long shopBranchId = 0L)
        {
            if (shopBranchId == 0L)
            {
                throw new HimallException("获取门店ID失败,不可提交非门店商品");
            }
            ((dynamic)base.ViewBag).shopBranchId = shopBranchId;
            ShippingAddressInfo userAddress = OrderApplication.GetUserAddress(addressId);

            ((dynamic)base.ViewBag).addId = addressId;
            if (userAddress != null)
            {
                ((dynamic)base.ViewBag).fullPath = RegionApplication.GetRegionPath(userAddress.RegionId);
                ((dynamic)base.ViewBag).fullName = RegionApplication.GetFullName(userAddress.RegionId, " ");
            }
            return(base.View(userAddress));
        }
예제 #11
0
        public JsonResult List(ShopBranchQuery query, int rows, int page)
        {
            query.PageNo   = page;
            query.PageSize = rows;
            query.ShopId   = (int)base.CurrentSellerManager.ShopId;
            if (query.AddressId.HasValue)
            {
                query.AddressPath = RegionApplication.GetRegionPath(query.AddressId.Value);
            }
            QueryPageModel <ShopBranch> shopBranchs = ShopBranchApplication.GetShopBranchs(query);
            DataGridModel <ShopBranch>  data        = new DataGridModel <ShopBranch>
            {
                rows  = shopBranchs.Models,
                total = shopBranchs.Total
            };

            return(base.Json(data));
        }
예제 #12
0
        public JsonResult List(ShopBranchQuery query, int rows, int page)
        {
            query.PageNo   = page;
            query.PageSize = rows;

            if (query.AddressId.HasValue)
            {
                query.AddressPath = RegionApplication.GetRegionPath(query.AddressId.Value);
            }
            var shopBranchs = ShopBranchApplication.GetShopBranchs(query);
            var dataGrid    = new DataGridModel <ShopBranch>()
            {
                rows  = shopBranchs.Models,
                total = shopBranchs.Total
            };

            return(Json(dataGrid));
        }
예제 #13
0
        /// <summary>
        /// 获得编辑收获地址页面
        /// </summary>
        /// <param name="addressId">收货地址Id</param>
        /// <param name="returnURL">返回url路径</param>
        public ActionResult EditShippingAddress(long addressId = 0, string returnURL = "", long shopBranchId = 0)
        {
            if (shopBranchId == 0)
            {
                throw new MallException("获取门店ID失败,不可提交非门店商品");
            }
            ViewBag.shopBranchId = shopBranchId;

            var ShipngInfo = OrderApplication.GetUserAddress(addressId);

            ViewBag.addId = addressId;
            if (ShipngInfo != null)
            {
                ViewBag.fullPath = RegionApplication.GetRegionPath(ShipngInfo.RegionId);
                ViewBag.fullName = RegionApplication.GetFullName(ShipngInfo.RegionId);
            }
            return(View(ShipngInfo));
        }
        public ActionResult Add(ShopBranch shopBranch)
        {
            try
            {
                if (!string.Equals(shopBranch.PasswordOne, shopBranch.PasswordTwo))
                {
                    throw new HimallException("两次密码输入不一致!");
                }
                if (string.IsNullOrWhiteSpace(shopBranch.PasswordOne) || string.IsNullOrWhiteSpace(shopBranch.PasswordTwo))
                {
                    throw new HimallException("密码不能为空!");
                }
                if (shopBranch.ShopBranchName.Length > 15)
                {
                    throw new HimallException("门店名称不能超过15个字!");
                }
                if (shopBranch.AddressDetail.Length > 50)
                {
                    throw new HimallException("详细地址不能超过50个字!");
                }
                if (shopBranch.Latitude <= 0 || shopBranch.Longitude <= 0)
                {
                    throw new HimallException("请搜索地址地图定位!");
                }
                string   regionIDList   = Request.Form["txtRegionScop"];
                string   regionNameList = Request.Form["txtRegionScopName"];
                string[] regionIdArr    = regionIDList.Split(',');
                string[] regionNameArr  = regionNameList.Split(',');

                if (shopBranch.ServeRadius <= 0 && string.IsNullOrWhiteSpace(regionIDList.Trim()))
                {
                    throw new HimallException("配送半径和配送范围不能同时为空!");
                }
                shopBranch.ShopId     = CurrentSellerManager.ShopId;
                shopBranch.CreateDate = DateTime.Now;
                long shopBranchId;
                ShopBranchApplication.AddShopBranch(shopBranch, out shopBranchId);
                if (shopBranchId > 0)
                {
                    #region 添加门店配送范围
                    List <DeliveryScope> deliveryScopList = new List <DeliveryScope>();
                    List <int>           regionIdList     = new List <int>();
                    DeliveryScope        info             = null;
                    for (int i = 0; i < regionIdArr.Length; i++)
                    {
                        int tempRegionId = 0;
                        if (int.TryParse(regionIdArr[i], out tempRegionId) && regionNameArr.Length >= i)
                        {
                            regionIdList.Add(tempRegionId);
                            if (!ShopBranchApplication.ExistsShopDeliveryScope(new ShopDeliveryScopeQuery()
                            {
                                ShopBranchId = shopBranchId, RegionId = tempRegionId
                            }))
                            {
                                info                = new DeliveryScope();
                                info.RegionId       = tempRegionId;
                                info.RegionName     = regionNameArr[i];
                                info.FullRegionPath = RegionApplication.GetRegionPath(tempRegionId);
                                info.FullRegionPath = CommonConst.ADDRESS_PATH_SPLIT + info.FullRegionPath + CommonConst.ADDRESS_PATH_SPLIT;//默认在结尾增加分隔符
                                info.ShopBranchId   = shopBranchId;
                                deliveryScopList.Add(info);
                            }
                        }
                    }
                    if (deliveryScopList.Count > 0)
                    {
                        ShopBranchApplication.AddShopDeliveryScope(deliveryScopList);
                    }
                    if (regionIdList.Count > 0)
                    {
                        ShopBranchApplication.DeleteShopDeliveryScope(new ShopDeliveryScopeQuery()
                        {
                            RegionIdList = regionIdList, ShopBranchId = shopBranchId
                        });                                                                                                                                      //清除旧数据
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
                return(Json(new Result()
                {
                    success = false, msg = ex.Message
                }));
            }
            return(Json(new Result()
            {
                success = true
            }));
        }