Exemplo n.º 1
0
        public async Task <IActionResult> In(int?Id, int?serverId)
        {
            var currentUser = await _userInfoManager.FindUser(User);

            /*try { await _locationService.GetLocationById(Id,serverId); }
             * catch { return NotFound(); }*/

            var Result = await _checkService.Checkin((int)Id, currentUser, (int)serverId);

            if (!Result.successful && Result.message == "User is already checked in at a location")
            {
                return(RedirectToAction("OutBeforeIn", new { idActual = Id, serverIdActual = serverId }));
            }

            return(RedirectToAction("Details", new { id = Id, serverId = serverId }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> checkin(int?id)
        {
            if (id != null)
            {
                CheckResult result = await _checkService.Checkin((int)id);

                if (result.successful)
                {
                    return(RedirectToAction("location", "Api", new { id }));
                }

                return(NotFound(result));
            }

            CheckResult checkResult = new CheckResult {
                successful = false, message = "Debe proveer el id de la locacion que desea buscar"
            };


            return(NotFound(checkResult));
        }