Esempio n. 1
0
        public async Task <IEnumerable <GetCardResponseDTO> > GetCardByProjectId(GetCardRequestDTO getCardRequestDTO)
        {
            try
            {
                List <GetCardResponseDTO> response      = new List <GetCardResponseDTO>();
                GetCardResponseDTO        cardResponses = null;
                //var result = await _unitOfWokDapper.CardQueries.GetCardByProjectId(getCardRequestDTO.ProjectId);

                var toDoResult = await _unitOfWokDapper.CardQueries.GetCardByStatus("TO DO");

                var inProgressResult = await _unitOfWokDapper.CardQueries.GetCardByStatus("IN PROGRESS");

                var forTestingResult = await _unitOfWokDapper.CardQueries.GetCardByStatus("FOR TESTING");

                var completedResult = await _unitOfWokDapper.CardQueries.GetCardByStatus("COMPLETED");

                var cardToDoResponses = new GetCardResponseDTO()
                {
                    Position = 0,
                    Name     = "TO DO",
                    Cards    = toDoResult
                };

                var cardInProgressResponses = new GetCardResponseDTO()
                {
                    Position = 1,
                    Name     = "IN PROGRESS",
                    Cards    = inProgressResult
                };

                var cardForTestingResponses = new GetCardResponseDTO()
                {
                    Position = 2,
                    Name     = "FOR TESTING",
                    Cards    = forTestingResult
                };

                var cardCompletedResponses = new GetCardResponseDTO()
                {
                    Position = 3,
                    Name     = "COMPLETED",
                    Cards    = completedResult
                };
                response.Add(cardToDoResponses);
                response.Add(cardInProgressResponses);
                response.Add(cardForTestingResponses);
                response.Add(cardCompletedResponses);

                //foreach (var res in result)
                //{
                //    cardResponses = new GetCardResponseDTO()
                //    {
                //        Name = "todo",

                //    };
                //    response.Add(cardResponses);
                //}
                return(response);
                //return null;
            }
            catch (Exception ex)
            {
                _logger.LogExceptionError(ex.ToString());
                throw ex;
            }
        }
        public async Task <IEnumerable <GetCardResponseDTO> > GetCardByProjectId(GetCardRequestDTO getCardRequestDTO)
        {
            return(await _cardService.GetCardByProjectId(getCardRequestDTO));

            //return new List<GetCardResponseDTO>()
            //{
            //    new GetCardResponseDTO()
            //    {
            //        Position = 0,
            //        Name = "TO DO",
            //        Cards = new List<Project.Management.System.Model.DTO.Common.Cards>()
            //        {
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            }
            //        }
            //    },
            //    new GetCardResponseDTO()
            //    {
            //        Position = 1,
            //        Name = "PENDING",
            //        Cards = new List<Project.Management.System.Model.DTO.Common.Cards>()
            //        {
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            },
            //            new Project.Management.System.Model.DTO.Common.Cards()
            //            {
            //                Header = "Test card",
            //                Description = "test desc",
            //                Summary = "test sum"
            //            }
            //        }
            //    }
            //};
        }