コード例 #1
0
ファイル: TicketLogic.cs プロジェクト: emc255/BugTracker
        //DELETE TICKET
        public void deleteTicket(Ticket ticket)
        {
            var ticketType     = TicketTypeRepo.GetEntity(x => x.Id == ticket.TicketTypeId);
            var ticketPriority = TicketPriorityRepo.GetEntity(x => x.Id == ticket.TicketPriorityId);
            var ticketStatus   = TicketStatusRepo.GetEntity(x => x.Id == ticket.TicketStatusId);
            var ticketComments = TicketCommentRepo.GetList(x => x.TicketId == ticket.Id);
            var ticketHistory  = TicketHistoryRepo.GetList(x => x.TicketId == ticket.Id);


            foreach (var comment in ticketComments)
            {
                TicketCommentRepo.Delete(comment);
            }

            foreach (var history in ticketHistory)
            {
                TicketHistoryRepo.Delete(history);
            }

            TicketRepo.Delete(ticket);
            TicketTypeRepo.Delete(ticketType);
            TicketPriorityRepo.Delete(ticketPriority);

            if (ticketStatus != null)
            {
                TicketStatusRepo.Delete(ticketStatus);
            }
        }
コード例 #2
0
 public void DeleteTicketPriorityLabel(int Id)
 {
     _repo.Delete(Id);
 }