public async Task <IActionResult> Switch(string SerialId)
        {
            var jwt = JwtService.GetJwt(HttpContext);

            if (jwt != null)
            {
                EnergyMetersService service = new EnergyMetersService(jwt);
                var responseMessage         = await service.Switch(jwt, SerialId);

                if (responseMessage.IsSuccessStatusCode)
                {
                    return(Redirect("GetAll"));
                }
                return(BadRequest());
            }
            else
            {
                return(RedirectToRoute(new { controller = "Account", action = "Login" }));
            }
        }
Пример #2
0
 private async Task Switch()
 {
     await service.Switch(this.SerialId);
 }