Beispiel #1
0
        public void UpdateStoryStatus(string id, string status, string ProjectId, string username, string userid)
        {
            Console.WriteLine("ProjectId received while moving user story to Product Backlog " + ProjectId);
            Console.WriteLine(status);


            _userStory.UpdateOne(
                usstory => usstory.Id == id,
                Builders <UserStoryIdZone> .Update.Set(usstory => usstory.Status, status));
            UserStoryIdZone obj    = _userStory.Find <UserStoryIdZone>(usstory => usstory.Id == id).FirstOrDefault();
            UserStoryIdeas  entity = new UserStoryIdeas();

            entity.linkedtoId         = obj.Id;
            entity.description        = obj.UserStoryName;
            entity.acceptanceCriteria = obj.UserStoryDescription;
            entity.action             = "put";
            entity.projectId          = ProjectId;
            if (status == "Backlog")
            {
                entity.action = "post";
            }
            else
            {
                entity.action = "delete";
            }
            Console.WriteLine("entity action " + entity.action);

            RabbitMQProducer producerM = new RabbitMQProducer();

            producerM.SendBacklog(entity);
            //producerM.SendBacklogBoard(entity);
            Console.WriteLine(entity);
            Logger_Domain logD = new Logger_Domain()
            {
                type        = "IdeaZone@UserStoriesMovedPB",
                description = "A member moved Userstories to Product Backlog",
                published   = DateTime.Now.Add(new TimeSpan(0, 5, 30, 0)),
            };
            Logger_Activity logA = new Logger_Activity()
            {
                id          = userid,
                type        = "Activity@UserStoryMovedPB",
                description = (status == "Backlog") ? username + " moved Userstory ( " + obj.UserStoryName + " ) to Product Backlog"
                                                   : username + " moved Userstory ( " + obj.UserStoryName + " )  back to Workspace",
                details = new data()
                {
                    id   = id,
                    name = ""
                },
                published = DateTime.Now,
                projectId = ProjectId
            };
            RabbitMQProducer producerA = new RabbitMQProducer();

            producerA.SendMessageToLoggerA(logA);
            Console.WriteLine(logA);
            RabbitMQProducer producerD = new RabbitMQProducer();

            producerD.SendMessageToLoggerD(logD);
            Console.WriteLine(logD);
        }