Exemplo n.º 1
0
        private FilterIdeaPassed GetFilterIdea(IdeaStatus ideaStatus, FilterStatus filterStatus, Guid userId)
        {
            var filterIdeaPassed = _filterIdeaPassedRepository.GetFilterIdea(ideaStatus.Id,
                                                                             filterStatus.Id,
                                                                             userId);

            return(filterIdeaPassed);
        }
Exemplo n.º 2
0
        public void CreateIdeaStatus(IdeaStatus cmd)
        {
            if (cmd == null)
            {
                throw new ArgumentNullException(nameof(cmd));
            }

            _access.IdeaStatuses.Add(cmd);
        }
Exemplo n.º 3
0
        private ChallengeSelectionIdeaDto InsertSelectionIdea(ChallengeSelectionIdeaDto challengeSelectionIdeaDto)
        {
            foreach (var idea in challengeSelectionIdeaDto.Review)
            {
                var reviewIdea = new IdeaStatus
                {
                    IdeaId   = idea.Id,
                    StatusId = Guid.Parse("11f4e235-bbee-4527-a88a-2d239aa91ee6"),
                    UserId   = Guid.Parse("5b7127e5-b581-4a87-bbdb-5312b9ded2cc")
                };
                _ideaStatusRepository.Add(reviewIdea);
            }

            foreach (var idea in challengeSelectionIdeaDto.Keep)
            {
                var keepIdea = new IdeaStatus
                {
                    IdeaId   = idea.Id,
                    StatusId = Guid.Parse("6b2ac6fa-0895-448b-8016-70b26355b211"),
                    UserId   = Guid.Parse("5b7127e5-b581-4a87-bbdb-5312b9ded2cc")
                };
                _ideaStatusRepository.Add(keepIdea);
            }

            foreach (var idea in challengeSelectionIdeaDto.Kill)
            {
                var killIdea = new IdeaStatus
                {
                    IdeaId   = idea.Id,
                    StatusId = Guid.Parse("e23a5191-5f41-4c00-b855-d87b14dc9180"),
                    UserId   = Guid.Parse("5b7127e5-b581-4a87-bbdb-5312b9ded2cc")
                };
                _ideaStatusRepository.Add(killIdea);
            }

            foreach (var idea in challengeSelectionIdeaDto.Multiply)
            {
                var multiplyIdea = new IdeaStatus
                {
                    IdeaId   = idea.Id,
                    StatusId = Guid.Parse("410031b0-0975-4769-88fb-ef742e2f7702"),
                    UserId   = Guid.Parse("5b7127e5-b581-4a87-bbdb-5312b9ded2cc")
                };
                _ideaStatusRepository.Add(multiplyIdea);
            }

            var challenge = _challengeRepository.GetById(challengeSelectionIdeaDto.ChallengeId);

            if (challenge.ChallengeState == 4)
            {
                challenge.ChallengeState += 1;
            }
            return(challengeSelectionIdeaDto);
        }
Exemplo n.º 4
0
 public IdeaDTO(Guid id, string title, string description, Guid authorId, DateTime startFundingDate, DateTime stopFundingDate, IdeaStatus status, double target, double fullfillment)
 {
     Id               = id;
     Title            = title;
     Description      = description;
     AuthorId         = authorId;
     StartFundingDate = startFundingDate;
     StopFundingDate  = stopFundingDate;
     Status           = status;
     Target           = target;
     Fullfillment     = fullfillment;
 }
Exemplo n.º 5
0
        public int CreateNewIdea(string ideaName, string ideaDescription, IdeaStatus ideaStatus = IdeaStatus.UnderReview, string userID = "",
                                 string contactName        = "Automation", string contactPhone    = "515-555-1212", string contactEmail = "*****@*****.**",
                                 WorkflowStep workflowStep = WorkflowStep.User, string assignedTo = "")
        {
            if (String.IsNullOrEmpty(userID))
            {
                userID = AutomationCore.SuperTest.Controller.fields["Domain"] + "\\" + AutomationCore.SuperTest.Controller.fields["UserId"];
            }
            if (string.IsNullOrEmpty(assignedTo))
            {
                assignedTo = userID;
            }
            DataTable newIdea         = new DataTable("Ideas");
            string    insertStatememt = string.Format(@"INSERT INTO Ideas ([Title], [Description], [StatusId], [CreatedDate], [UpdatedDate], [SubmittedDate], [CreatedBy], [UpdatedBy], [SubmittedBy], [AssignTo], [WorkflowStep]) VALUES ('{0}', '{1}', {3}, GETDATE(), GETDATE(), GETDATE(), '{2}', '{2}', '{2}', '{5}', {4}); SELECT SCOPE_IDENTITY() as NewIdeaNumber;", ideaName, ideaDescription, userID, (int)ideaStatus, (int)workflowStep, assignedTo);

            newIdea.Load(GetRecords(insertStatememt));
            AutomationCore.base_tests.BaseTest.WriteReport("Idea " + newIdea.Rows[0][0] + " created...");
            return(int.Parse(newIdea.Rows[0][0].ToString()));
        }
Exemplo n.º 6
0
 public void UpdateIdeaStatus(IdeaStatus ideaStatus)
 {
     _access.Update(ideaStatus);
 }
Exemplo n.º 7
0
 public void DeleteIdeaStatus(IdeaStatus ideaStatus)
 {
     _access.Remove(ideaStatus);
 }