Ejemplo n.º 1
0
        public void Register(RegisterTicketCommand command)
        {
            command.Validate();

            if (AddNotifications(command))
            {
                return;
            }

            TicketCategory     category = _categoryRepository.GetById(command.CategoryId);
            LedgerIdentityUser user     = _identityResolver.GetUser();

            if (NotifyNullCategory(category))
            {
                return;
            }

            Ticket ticket = _factory.OpenTicket(command.Title, command.Details, command.CategoryId, user.Id);

            _ticketRepository.Register(ticket);

            if (Commit())
            {
                PublishLocal(new TicketRegisteredEvent(ticket.Id, ticket.Title, ticket.Details));
            }
        }
Ejemplo n.º 2
0
 public TicketCategory GetById(Guid id)
 {
     return(_repository.GetById(id));
 }
Ejemplo n.º 3
0
        public void deleteCategory(int id)
        {
            TicketCategory cat = categoryRepo.GetById(id);

            categoryRepo.Delete(cat);
        }