//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); } }
public void DeleteTicketPriorityLabel(int Id) { _repo.Delete(Id); }