public async Task <IActionResult> ActivateAccount(AccountActivationRequestModel model) { ViewData["UserEmail"] = HttpContext.Session.GetString("UserEmail"); var jwtToken = HttpContext.Session.GetString("Token"); var AccountActivate = new AccountActivationRequestModel { Email = ViewData["UserEmail"].ToString(), Code = model.Code }; GenericResponseModel response = new GenericResponseModel(); var apiResponse = await httpClientConfig.ApiPutResponse("Facilitator/activateAccount", AccountActivate, jwtToken); response = JsonConvert.DeserializeObject <GenericResponseModel>(apiResponse); if (response.StatusCode == 200) { TempData["alert"] = "alert-success"; ViewBag.Message = response.StatusMessage; return(View()); // return RedirectToAction("index", "Facilitator"); } else { TempData["alert"] = "alert-danger"; ViewBag.Message = response.StatusMessage; return(View()); } }
public async Task <IActionResult> ActivateSchool(AccountActivationRequestModel model) { ViewData["UserEmail"] = HttpContext.Session.GetString("UserEmail"); var jwtToken = HttpContext.Session.GetString("Token"); GenericResponseModel response = new GenericResponseModel(); var apiResponse = await httpClientConfig.ApiPutResponse("School/activateAccount", model, jwtToken); response = JsonConvert.DeserializeObject <GenericResponseModel>(apiResponse); if (response.StatusCode == 200) { TempData["alert"] = "alert-success"; ViewBag.Message = response.StatusMessage; return(View()); } else { TempData["alert"] = "alert-danger"; ViewBag.Message = response.StatusMessage; return(View()); } }