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)); }
public JsonResult PurchaseAirtime(BuyAirtimeViewModel viewModel) { _buyAirtimeAppService.BuyAirtime(ObjectMapper.Map <AirtimePurchaseDto>(viewModel)); return(Json(new { })); }