Ejemplo n.º 1
0
        public IActionResult Update(long id, Tasks1 bookIn, string username, string userid, string projectid)
        {
            var book  = _tasksService.PutByGanttId(id, bookIn);
            var book1 = _tasksService.GetByGanttId(id);

            if (book1 == null)
            {
                return(NotFound());
            }

            Tasks obj = new Tasks()
            {
                TaskId     = book1.TaskId,
                id         = book1.id,
                project_id = book1.project_id,
                action     = "put",
                start_date = book1.start_date,
                end_date   = book1.end_date,
                duration   = book1.duration,
                progress   = book1.progress,
                text       = book1.text,

                unique_id = book1.unique_id
            };

            RabbitMQProducer producer2 = new RabbitMQProducer();

            producer2.UpdateUserStoryToBoards(obj);

            // UpdUS logger =new UpdUS(){
            //     type="Gantt@UpdateUserStory",
            //     id ="userid",
            //     description=username+" updated"+ bookIn.text +"UserStory in gantt chart",
            //     published=DateTime.Now,
            //     data=new Data(){
            //         id=bookIn.id,
            //         name=bookIn.text
            //     }
            // };
            //  RabbitMQProducer producer=new RabbitMQProducer();
            // producer.UpdateUserStory(logger);

            Logger logger1 = new Logger()
            {
                published   = DateTime.Now,
                type        = "activity@UpdateUserStory",
                id          = userid,
                project_id  = projectid,
                description = username + " updated " + bookIn.text + " in gantt chart",
                data        = new Data()
                {
                    id   = bookIn.id,
                    name = bookIn.text
                }
            };

            //Console.WriteLine(JsonConvert.SerializeObject(logger1));
            //Console.WriteLine(logger1);
            _loggerService.Create(logger1);
            //  RabbitMQProducer producer1=new RabbitMQProducer();
            // producer.UpdateUserStoryAct(logger1);


            return(NoContent());
        }