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

            response.EnsureSuccessStatusCode();
            return(RedirectToAction("GetAllAdmins"));
        }
예제 #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));
        }