public JsonResult GetDetail(System.Int32 id)
        {
            PosAddressDetailView vm      = new PosAddressDetailView();
            GetPosAddressRequest request = new GetPosAddressRequest();

            request.AddressId = id;
            GetPosAddressResponse response = _posAddressService.GetPosAddress(request);

            if (response.PosAddressFound)
            {
                vm = response.PosAddress.ConvertToPosAddressDetailView();
            }

            return(Json(vm, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public GetPosAddressResponse GetPosAddress(GetPosAddressRequest request)
        {
            GetPosAddressResponse response = new GetPosAddressResponse();

            PosAddress posAddress = _posAddressRepository
                                    .FindBy(request.AddressId);

            if (posAddress != null)
            {
                response.PosAddressFound = true;
                response.PosAddress      = posAddress.ConvertToPosAddressView();
            }
            else
            {
                response.PosAddressFound = false;
            }


            return(response);
        }