Ejemplo n.º 1
0
 public IHttpActionResult GetListingPaymentModes(int id)
 {
     var listingFacade = (IListingFacade)FacadeFactory.Instance.Create(FacadeType.Listing);
     var listingResult = listingFacade.GetPaymentModesByListingId(id);
     var listingViewModel = new ListingViewModel();
     if (listingResult.IsValid() && listingResult.Data.ListingPaymentModes != null)
     {
         foreach (var listingPaymentMode in listingResult.Data.ListingPaymentModes.PaymentModes)
         {
             var listingPaymentModeViewModel = new PaymentModeViewModel();
             DTOConverter.FillViewModelFromDTO(listingPaymentModeViewModel, listingPaymentMode);
             listingViewModel.ListingPaymentModes.PaymentModes.Add(listingPaymentModeViewModel);
         }
     }
     return Ok(listingViewModel.ListingPaymentModes);
 }
 public ListingPaymentModesViewModel()
 {
     PaymentModes = new List<PaymentModeViewModel>();
     NewPaymentMode = new PaymentModeViewModel();
 }