Ejemplo n.º 1
0
        public ActionResult ChangeIterationState(long iterationId, IterationState state)
        {
            using (var context = new TenantContext(WebSecurity.CurrentUserSubscriptionId))
            {
                var db = context.Database;

                Iteration iteration;
                if (!db.Iterations.TryGetById(iterationId, out iteration))
                {
                    //TODO: Log
                    return Json(false);
                }

                iteration.State = state;
                db.SaveChanges();

                return Json(true);
            }
        }
Ejemplo n.º 2
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            var susbcriptionId = WebSecurity.CurrentUserSubscriptionId;
            Context = new TenantContext(susbcriptionId);

            ViewBag.UserName = Context.Users.GetById(WebSecurity.CurrentUserId).Name;

            var subscription = Context.Database.Subscriptions.GetById(susbcriptionId);
            ViewBag.TenantName = subscription.CompanyName;
            ViewBag.EmailDomain = subscription.EmailDomain;
            ViewBag.ShowChatCollapsed = true;
        }
Ejemplo n.º 3
0
        public ActionResult UserStory(long userStoryId)
        {
            using (var context = new TenantContext(WebSecurity.CurrentUserSubscriptionId))
            {
                Issue userStory;
                if (!context.Database.Issues.TryGetById(userStoryId, out userStory))
                {
                    //TODO: Log
                    return Json(new JsonResponse<IssueModel> { Success = false });
                }

                var response = new JsonResponse<IssueModel>
                {
                    Data = new IssueModel
                    {
                        Id = userStory.Id,
                        Summary = userStory.Summary,
                        Description = userStory.Description
                    },
                    Success = true
                };

                return Json(response);
            }
        }