Exemplo n.º 1
0
        public IActionResult Index()
        {
            PlatformIndexViewModel viewModel = new PlatformIndexViewModel
            {
                Platforms     = platformService.GetAll(),
                PlatformTypes = platformTypeService.GetAll()
            };

            return(View(viewModel));
        }
Exemplo n.º 2
0
 public ActionResult AddConnect(PlatformIndexViewModel newconnect)
 {
     if (ModelState.IsValid)
     {
         adminService.AddConnect(newconnect.DeviceId, newconnect.IdCard, User.Identity.Name);
         return(JavaScript("location.reload(true)"));
     }
     else
     {
         return(PartialView("_AddConnect", newconnect));
     }
 }
Exemplo n.º 3
0
        // GET: Platform
        public ActionResult Index()
        {
            Members user = memberService.GetAccount(User.Identity.Name);

            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            else if (user.isAdmin == true)
            {
                return(RedirectToAction("AdminIndex", "Platform"));
            }
            else
            {
                PlatformIndexViewModel data = new PlatformIndexViewModel();
                data.ConnectDevice = adminService.GetConnectTable(User.Identity.Name);
                data.Wears         = adminService.GetElderList();
                return(View(data));
            }
        }
Exemplo n.º 4
0
 public JsonResult ElderCheck(PlatformIndexViewModel NewConnect)
 {
     return(Json(adminService.ElderCheck(NewConnect.Name, NewConnect.IdCard), JsonRequestBehavior.AllowGet));
 }
Exemplo n.º 5
0
 //Check
 public JsonResult DeviceCheck(PlatformIndexViewModel NewConnect)
 {
     return(Json(!adminService.FindDevice(NewConnect.DeviceId), JsonRequestBehavior.AllowGet));
 }