public IViewComponentResult Invoke()
        {
            AppUserModel userModel = new AppUserModel();

            userModel = SessionExtension.Get <AppUserModel>(HttpContext.Session, "Login");
            return(View(userModel));
        }
Пример #2
0
        public PartialViewResult _UserInfo()
        {
            AppUserModel userModel = new AppUserModel();

            userModel = SessionExtension.Get <AppUserModel>(HttpContext.Session, "Login");
            if (userModel != null)
            {
                return(PartialView(userModel));
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        public IActionResult Login()
        {
            AppUserModel userModel = new AppUserModel();

            userModel = SessionExtension.Get <AppUserModel>(HttpContext.Session, "Login");
            if (userModel != null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                return(View());
            }
        }
Пример #4
0
        public IActionResult GetStructs()
        {
            return(ActionExecute(() =>
            {
                var file = SessionExtension.Get <FileData>(session, Key.File);

                if (file == null)
                {
                    return BadRequest("Kérem töltsön fel először fájlt!");
                }

                var structs = Analyzer.GetStructs(file.Content);

                return Ok(structs);
            }));
        }
Пример #5
0
        public IActionResult Update([FromBody] List <AnalyzeData> analyzeDatas)
        {
            return(ActionExecute(() =>
            {
                var file = SessionExtension.Get <FileData>(session, Key.File);
                var controlFlowGraphJson = session.GetString(Key.ControlFlowGraph.ToString("g"));
                var dataFlowGraphJson = session.GetString(Key.DataFlowGraph.ToString("g"));
                var analyzers = new List <Analyzer>();

                if (file == null || controlFlowGraphJson == null || dataFlowGraphJson == null)
                {
                    return BadRequest("Kérem töltsön fel először fájlt!");
                }

                analyzeDatas.ForEach(x =>
                {
                    analyzers.Add(new Analyzer(controlFlowGraphJson, dataFlowGraphJson, x, file.Content));
                });

                Parallel.ForEach(analyzers, (analyzer) =>
                {
                    analyzer.Analyze();
                    analyzer.FinishOperations();
                });

                analyzers.DistinctGraphs(out List <List <ViewNode> > controlFlowGraphs, out List <List <ViewNode> > dataFlowGraphs);
                analyzers.CreateCharts(out BarChartData readAndWriteChartData, out PieChartData useVariable, out PieChartData useful, out BarChartData headers);

                var calculateData = new CalculatedData
                {
                    ControlFlowGraphs = controlFlowGraphs,
                    DataFlowGraphs = dataFlowGraphs,
                    ReadAndWriteChartData = readAndWriteChartData,
                    UseVariable = useVariable,
                    Useful = useful,
                    Headers = headers,
                    File = file
                };

                return Ok(calculateData);
            }));
        }