public async Task <ActionResult> ChangeActiveProject(int id)
        {
            var model         = new ProjectBoxViewModel();
            var activeProject = int.Parse(User.Identity.GetActiveProject());

            ViewBag.AllProjects = true;
            model.ProjectName   = projectServices.GetById(id).ProjectName;

            var user = UserManager.FindById(User.Identity.GetUserId());

            user.ActiveProject = id;

            IdentityResult result = await UserManager.UpdateAsync(user);

            var some = User.Identity.GetActiveProject();

            Response.Headers["ProjectIsChanged"] = id.ToString();
            model.IdProject = UserActiveProject;
            return(PartialView("LayoutPartials/ProjectSmallBox", model));
        }
        public async Task <ActionResult> ProjectBox(int?id)
        {
            var model         = new ProjectBoxViewModel();
            var activeProject = int.Parse(User.Identity.GetActiveProject());
            var userId        = User.Identity.GetUserId();

            if (!projectServices.GetForUser(userId).Any())
            {
                return(PartialView("LayoutPartials/ProjectSmallBox", model));
            }

            if (id.HasValue && id != 0)
            {
                ViewBag.AllProjects = true;
                model.ProjectName   = projectServices.GetById(id ?? 0).ProjectName;
                model.IdProject     = UserActiveProject;

                return(PartialView("LayoutPartials/ProjectSmallBox", model));
            }
            if (id == 0)
            {
                ViewBag.AllProjects = true;
                return(PartialView("LayoutPartials/ProjectSmallBox", model));
            }
            if (activeProject != 0)
            {
                ViewBag.AllProjects = true;
                model.ProjectName   = projectServices.GetById(activeProject).ProjectName;
                model.IdProject     = UserActiveProject;

                return(PartialView("LayoutPartials/ProjectSmallBox", model));
            }
            ViewBag.AllProjects = true;

            return(PartialView("LayoutPartials/ProjectSmallBox", model));
        }