예제 #1
0
        public IActionResult Delete(long id, string username, string userid, string projectid)
        {
            var book = _tasksService.GetByGanttId(id);

            if (book == null)
            {
                return(NotFound());
            }
            Tasks obj = new Tasks()
            {
                id         = book.id,
                TaskId     = book.TaskId,
                project_id = book.project_id,
                action     = "delete",
                start_date = book.start_date,
                end_date   = book.end_date,
                duration   = book.duration,
                progress   = book.progress,
                text       = book.text,
                unique_id  = book.unique_id
            };

            RabbitMQProducer producer2 = new RabbitMQProducer();

            producer2.DeleteUSerStoryFromBoards(obj);


            //Console.WriteLine(JsonConvert.SerializeObject(book));
            _tasksService.RemoveByGanttId(id);

            // DelUS logger =new DelUS(){
            //     type="Gantt@DeleteUserStory",
            //     id ="userid",
            //     description=username+" deleted"+ book.text +"UserStory from gantt chart",
            //     published=DateTime.Now,
            //     data=new Data(){
            //         id=book.id
            //     }
            // };
            //  RabbitMQProducer producer=new RabbitMQProducer();
            // producer.DelUserStory(logger);

            Logger logger1 = new Logger()
            {
                type        = "activity@DeleteUserStory",
                id          = userid,
                project_id  = projectid,
                description = username + " deleted " + book.text + " from gantt chart",
                published   = DateTime.Now,
                data        = new Data()
                {
                    id = book.id
                }
            };

            //Console.WriteLine(JsonConvert.SerializeObject(logger1));
            // Console.WriteLine(logger1);
            _loggerService.Create(logger1);
            //  RabbitMQProducer producer1=new RabbitMQProducer();
            // producer1.DelUserStoryAct(logger1);
            return(NoContent());
        }