Ejemplo n.º 1
0
        /// <summary>
        /// 获取门店
        /// </summary>
        /// <returns></returns>
        public static ShopBranch GetShopBranchById(long id)
        {
            var branchInfo = _shopBranchService.GetShopBranchById(id);

            if (branchInfo == null)
            {
                return(null);
            }
            var branchManagers = _shopBranchService.GetShopBranchManagers(id);
            var shopBranch     = AutoMapper.Mapper.Map <ShopBranchInfo, ShopBranch>(branchInfo);

            //补充地址中文名称
            //shopBranch.AddressFullName = RegionApplication.GetFullName(shopBranch.AddressId, CommonConst.ADDRESS_PATH_SPLIT);
            shopBranch.AddressFullName = RenderAddress(shopBranch.AddressPath, shopBranch.AddressDetail, 0);
            if (branchManagers != null && branchManagers.Count() > 0)
            {//补充管理员名称
                shopBranch.UserName = branchManagers.FirstOrDefault().UserName;
            }
            return(shopBranch);
        }