Ejemplo n.º 1
0
        public ActionResult Index()
        {
            IUserService _us   = new UserServicesImpl(_context, _config);
            string       token = HttpContext.Session.GetString("token");

            if (_us.ValidateCurrentToken(token))
            {
                string username = _us.GetClaim(token, "userId");

                ISearchService _ss = new SearchServiceImp(_context, _config);
                ViewBag.files = _ss.GetFiles(username, null);

                ILogService _ls = new LogServicesImp(_context, _config);
                ViewBag.logs = _ls.getLog(username);

                IFolderService _fs = new FolderServicesImp(_context, _config);
                ViewBag.folders = _fs.GetAllFoldersByUserId(username);

                return(View());
            }
            else
            {
                return(Redirect("~/Login"));
            }
        }
Ejemplo n.º 2
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            IUserService _us      = new UserServicesImpl(_context, _config);
            string       token    = HttpContext.Session.GetString("token");
            string       folderId = Request.Query["id"];

            if (_us.ValidateCurrentToken(token))
            {
                string username = _us.GetClaim(token, "userId");

                ISearchService _ss = new SearchServiceImp(_context, _config);
                ViewBag.files = _ss.GetFiles(username, folderId, 0);

                IFolderService _fs    = new FolderServicesImp(_context, _config);
                Folder         folder = _fs.GetFolderById(folderId);
                ViewBag.FolderName = folder.FolderName;
                ViewBag.FolderId   = folder.GUID;

                return(View());
            }
            else
            {
                return(Redirect("~/Login"));
            }
        }