Esempio n. 1
0
        public ActionResult CreateAdmin(AdminModel admin)
        {
            ServiceRepository   serviceObj = new ServiceRepository();
            HttpResponseMessage response   = serviceObj.PostResponse("api/admin/InsertAdmin", admin);

            response.EnsureSuccessStatusCode();
            return(RedirectToAction("GetAllAdmins"));
        }
Esempio n. 2
0
        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));
        }