Ejemplo n.º 1
0
        public List <OutgoingIterationModel> GetIterations([FromBody] IncomingIterationRequest request)
        {
            var result = new List <OutgoingIterationModel>();

            using (var context = new WorkItemsContext(Context, Configuration))
            {
                var dataResult = context.GetProjectIterations(request.ProjectId);
                dataResult.ForEach(x =>
                {
                    var boardName = string.Empty;
                    if (request.Calling == "Sprints")
                    {
                        boardName = request.IsPublic ? "Boards/PublicBoard" : "Boards/Sprints";
                    }
                    else
                    {
                        boardName = request.Calling;
                    }
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = x.IterationName,
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/{boardName}?projectId={request.ProjectId}&&workItemType=7&&iteration={x.Id}&&person=0"
                    });
                });
            }
            return(result);
        }
Ejemplo n.º 2
0
        public List <OutgoingIterationModel> GetIterations([FromBody] IncomingIterationRequest request)
        {
            var result = new List <OutgoingIterationModel>();

            using (var context = new DatabaseController(Context, Configuration))
            {
                var dataResult = context.GetProjectIterations(request.ProjectId);
                dataResult.ForEach(x =>
                {
                    var boardName = request.IsPublic ? "PublicBoard" : "Sprints";
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = x.IterationName,
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/{boardName}?projectId={request.ProjectId}&&workItemType=7&&iteration={x.Id}&&person=0"
                    });
                });
            }
            return(result);
        }
Ejemplo n.º 3
0
        public List <OutgoingIterationModel> GetPersons([FromBody] IncomingIterationRequest request)
        {
            var result = new List <OutgoingIterationModel>();

            using (var context = new DatabaseController(Context, Configuration))
            {
                var dataResult  = new List <UserAccounts>();
                var currentUser = this.User;
                var email       = currentUser.Claims.LastOrDefault().Value;
                var userRights  = context.GetUserAccounts(int.Parse(email));
                if (userRights != null)
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "All",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person=0"
                    });
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "@Mine",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={userRights.Id}"
                    });
                    dataResult = context.GetProjectPerons(request.ProjectId);
                }
                dataResult.ForEach(x =>
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = x.GitUsername,
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={x.Id}"
                    });
                });
            }
            return(result);
        }
Ejemplo n.º 4
0
        public List <OutgoingIterationModel> GetPersons([FromBody] IncomingIterationRequest request)
        {
            var result = new List <OutgoingIterationModel>();

            using (var context = new UsersContext(Context, Configuration))
            {
                var dataResult = new List <UserAccounts>();

                var userRights = AutherizationManager.ValidateUserRights(request.ProjectId, UserId, context);
                if (userRights != null)
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "All",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person=0"
                    });
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "@Mine",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={userRights.Id}"
                    });
                    dataResult = context.GetProjectPersons(request.ProjectId);
                }
                dataResult.ForEach(x =>
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = x.GitUsername,
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={x.Id}"
                    });
                });
            }
            return(result);
        }