Example #1
0
        /// <summary>
        /// 获取收货地址
        /// </summary>
        /// <param name="regionId"></param>
        /// <returns></returns>
        private Entities.ShippingAddressInfo GetShippingAddress(long?regionId)
        {
            Entities.ShippingAddressInfo result = null;
            if (regionId != null)
            {
                result = _iShippingAddressService.GetUserShippingAddress((long)regionId);
            }
            else
            {
                result = _iShippingAddressService.GetDefaultUserShippingAddressByUserId(CurrentUser.Id);
            }

            return(result);
        }
        public JsonResult GetShippingAddress(long id)
        {
            var address = _iShippingAddressService.GetUserShippingAddress(id);
            var json    = new
            {
                id               = address.Id,
                fullRegionName   = address.RegionFullName,
                address          = address.Address,
                phone            = address.Phone,
                shipTo           = address.ShipTo,
                fullRegionIdPath = address.RegionIdPath
            };

            return(Json(json));
        }
 /// <summary>
 /// 获取用户的收货地址列表
 /// </summary>
 /// <param name="shippingAddressId">收货地址Id</param>
 /// <returns></returns>
 public static ShippingAddressInfo GetUserShippingAddress(long shippingAddressId)
 {
     return(_iShippingAddressService.GetUserShippingAddress(shippingAddressId));
 }