/// <summary> /// 收货地址详情 /// </summary> /// <param name="addressId">地址ID</param> /// <param name="appId">appId</param> /// <returns></returns> public Jinher.AMP.BTP.Deploy.CustomDTO.AddressSDTO GetDeliveryAddressByAddressIdExt(System.Guid addressId, System.Guid appId) { var deliveryAddress = DeliveryAddress.ObjectSet().Where(n => n.Id == addressId).FirstOrDefault(); AddressSDTO address = new AddressSDTO(); if (deliveryAddress != null) { address.AddressId = deliveryAddress.Id; address.UserId = deliveryAddress.UserId; address.ReceiptUserName = deliveryAddress.RecipientsUserName; address.ReceiptPhone = deliveryAddress.RecipientsPhone; address.ReceiptAddress = deliveryAddress.RecipientsAddress; address.Province = deliveryAddress.Province; address.City = deliveryAddress.City; address.District = deliveryAddress.District; address.Street = deliveryAddress.Street; address.AppId = deliveryAddress.AppId; address.RecipientsZipCode = deliveryAddress.RecipientsZipCode; address.IsDefault = deliveryAddress.IsDefault == true ? 1 : 0; address.ProvinceCode = deliveryAddress.ProvinceCode; address.CityCode = deliveryAddress.CityCode; address.DistrictCode = deliveryAddress.DistrictCode; address.StreetCode = deliveryAddress.StreetCode; } return(address); }
public void TestGetDeliveryAddressByAddressId() { AddressSDTO addressSDTO = new AddressSDTO(); string requestData = "{\"addressId\":\"\",\"appId\":\"" + Setting.AppId + "\"}"; var rest = new RestRequestTest("Jinher.AMP.BTP.SV.DeliveryAddressSV.svc/GetDeliveryAddressByAddressId"); string retJson = rest.Execute(requestData); //ReturnDTO returnDTO = JsonHelper.JsonDeserialize<ReturnDTO>(retJson); }
public void TestSaveDeliveryAddress() { AddressSDTO addressSDTO = new AddressSDTO(); addressSDTO.AppId = Guid.Parse(Setting.AppId); addressSDTO.UserId = Guid.Parse(Setting.UserId); addressSDTO.City = "北京"; addressSDTO.District = "海淀区"; addressSDTO.Province = "北京"; addressSDTO.ReceiptAddress = "上地东路1号盈创动力大厦A座北厅401室"; addressSDTO.ReceiptPhone = "15810819038"; addressSDTO.ReceiptUserName = "******"; string requestData = "{\"addressDTO\":" + JsonHelper.JsonSerializer <AddressSDTO>(addressSDTO) + "}"; var rest = new RestRequestTest("Jinher.AMP.BTP.SV.DeliveryAddressSV.svc/SaveDeliveryAddress"); string retJson = rest.Execute(requestData); //ReturnDTO returnDTO = JsonHelper.JsonDeserialize<ReturnDTO>(retJson); }