public IActionResult Pay(ShippingViewModel shippingModel) { if (ModelState.IsValid) { //TempData["ShippingViewModel"] = model; var w = wardService.GetById(int.Parse(shippingModel.Ward)); var d = districtService.GetById(int.Parse(shippingModel.District)); var p = provinceService.GetById(int.Parse(shippingModel.Province)); string ward = string.Format("{0} {1}", w.Type, w.Name); string district = string.Format("{0} {1}", d.Type, d.Name); string province = string.Format("{0} {1}", p.Type, p.Name); shippingModel.Address = string.Format("{0}, {1}, {2}, {3}", shippingModel.Address, ward, district, province); return(Payment(shippingModel)); } return(View(shippingModel)); }
public IActionResult GetById(int id) { var model = _wardService.GetById(id); return(new OkObjectResult(model)); }