コード例 #1
0
        public IActionResult Index()
        {
            var airtimeNetworks     = _airtimeNetworkRepository.GetAllList();
            var airtimeNetworkItems = new List <SelectListItem>
            {
                new SelectListItem("Select Network", "-1")
            };

            foreach (var airtimeNetwork in airtimeNetworks)
            {
                airtimeNetworkItems.Add(new SelectListItem(airtimeNetwork.NetworkName, airtimeNetwork.NetworkName));
            }

            var viewModel = new BuyAirtimeViewModel
            {
                AirtimeNetworks = airtimeNetworkItems
            };

            return(View(viewModel));
        }
コード例 #2
0
 public JsonResult PurchaseAirtime(BuyAirtimeViewModel viewModel)
 {
     _buyAirtimeAppService.BuyAirtime(ObjectMapper.Map <AirtimePurchaseDto>(viewModel));
     return(Json(new { }));
 }