public ActionResult Create(Models.PoDetail PoDetail) { ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PostResponse("api/PoDetail/InsertPoDetail", PoDetail); response.EnsureSuccessStatusCode(); return(RedirectToAction("GetAllPoDetails")); }
public ActionResult Details(int id) { ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.GetResponse("api/PoDetail/GetPoDetail?id=" + id.ToString()); response.EnsureSuccessStatusCode(); Models.PoDetail PoDetails = response.Content.ReadAsAsync <Models.PoDetail>().Result; ViewBag.Title = "All PoDetails"; return(View(PoDetails)); }