public JsonResult Login(AppUserLoginModel appUserLoginModel) { Response response = new Response(); tokenProvider = new TokenProvider(); try { appUserProvider = new AppUserProvider(); AppUserModel appuserModel = appUserProvider.GetLoginUser(appUserLoginModel).ResultModel; if (appuserModel != null) { SessionExtension.Set <AppUserModel>(HttpContext.Session, "Login", appuserModel); response = new Response() { Message = "success", Status = true, RedirectUrl = Url.Action("Index", "Home") }; } } catch (Exception ex) { response = new Response() { Message = "Fail", Status = false, }; } return(Json(response)); }
public JsonResult GetJsonPost() { informationContentProvider = new InformationContentProvider(); tokenProvider = new TokenProvider(); string token = string.Empty; InfrastructureModel <InformationContentSingleDataModel> infrastructureModel = new InfrastructureModel <InformationContentSingleDataModel>(); if (SessionExtension.GetSessionUser(HttpContext.Session) == null) { token = tokenProvider.GetAnonimToken(); SessionExtension.Set(HttpContext.Session, "FreeToken", token); infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel() { TokenKey = token }); } else { AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session); if (appUserModel != null) { token = appUserModel.TokenKey; infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel() { AppUserId = appUserModel.AppUser.AppUserId, TokenKey = token }); } } return(Json(infrastructureModel)); }
public IActionResult FileUpload([FromBody] FileData file) { return(ActionExecute(() => { if (file.Content == null || string.IsNullOrWhiteSpace(file.Content)) { return BadRequest("Üres fájl!"); } var content = file.Content; SessionExtension.Set(session, Key.File, file); var controlFlowGraph = P4ToGraph.ControlFlowGraph(ref content); SessionExtension.SetGraph(session, Key.ControlFlowGraph, controlFlowGraph); var dataFlowGraph = P4ToGraph.DataFlowGraph(content, controlFlowGraph); SessionExtension.SetGraph(session, Key.DataFlowGraph, dataFlowGraph); return Ok(file); })); }