Exemplo n.º 1
0
        public HttpResponseMessage MarkCoreInfoAsRead(int issueId, string type)
        {
            HttpResponseMessage msg = new HttpResponseMessage();

            if (type == "Criterion")
            {
                IssueBrCriteria ibc = new IssueBrCriteria();
                ibc.MarkAsRead(issueId, GetUserIdFromClaim());
            }
            else if (type == "Alternative")
            {
                IssueBrAlternative iba = new IssueBrAlternative();
                iba.MarkAsRead(issueId, GetUserIdFromClaim());
            }

            msg.StatusCode = System.Net.HttpStatusCode.OK;
            return(msg);
        }
Exemplo n.º 2
0
        public ActionResult BrAlternatives(int issueId)
        {
            BrAlternativesVM vm = new BrAlternativesVM();
            IssueCreating    ic = new IssueCreating();
            int userId          = GetUserIdFromClaim();

            vm.Issue = ic.GetIssue(issueId);
            if (vm.Issue.Status == "CREATING")
            {
                return(RedirectToAction("Creating", "Issue", new { issueId = issueId }));
            }
            IssueBrAlternative iba = new IssueBrAlternative();

            vm.Alternatives = iba.GetIssueAlternatives(issueId, userId);
            vm.AccessRight  = ic.AccessRightOfUserForIssue(userId, issueId).Right;
            vm.UserId       = userId;
            if (iba.MarkAsRead(issueId, userId))
            {
                var ctx2 = GlobalHost.ConnectionManager.GetHubContext <NotificationHub>();
                ctx2.Clients.All.updateActivity(issueId, userId);
            }
            return(View(vm));
        }