public ActionResult CreateAdmin(AdminModel admin) { ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PostResponse("api/admin/InsertAdmin", admin); response.EnsureSuccessStatusCode(); return(RedirectToAction("GetAllAdmins")); }
public ActionResult Details(int id) { ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.GetResponse("api/admin/GetAdmin?id=" + id.ToString()); response.EnsureSuccessStatusCode(); AdminModel admins = response.Content.ReadAsAsync <AdminModel>().Result; ViewBag.Title = "All Admins"; return(View(admins)); }