Beispiel #1
0
        public async Task <IActionResult> Out(int?Id, int?serverId)
        // el parametro Id no es la Id de la locacion de la que se hará Check Out sino de la locacion
        // cuyos detalles se muestran luego del Check Out
        {
            var currentUser = await _userInfoManager.FindUser(User);

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

            await _checkService.Checkout(currentUser);


            return(RedirectToAction("Details", new { id = Id, serverId }));
        }
Beispiel #2
0
        public async Task <IActionResult> checkout(int?id)
        {
            if (id != null)
            {
                CheckResult result = await _checkService.Checkout((int)id);

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

                return(NotFound(JsonSerializer.Serialize(result)));
            }

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


            return(NotFound(checkResult));
        }