public DomainModel.TicketHistory CreateTicketHistory(TicketHistoryRequest TicketHistory) { var entityToInsert = new DomainModel.TicketHistory() { }; MergeTicketHistory(entityToInsert, TicketHistory); TicketHistoryRepository.Insert(entityToInsert); return(entityToInsert); }
public DomainModel.TicketHistory GetById(int TicketHistoryId) { var TicketHistory = TicketHistoryRepository.GetById(TicketHistoryId); if (TicketHistory == null) { throw new BadRequestException(ErrorMessages.TicketHistoryNoEncontrado); } return(TicketHistory); }
public IList <DomainModel.TicketHistory> GetAll() { var TicketHistorys = TicketHistoryRepository.GetAll(); if (TicketHistorys == null) { throw new BadRequestException(ErrorMessages.TicketHistoryNoEncontrado); } var result = new List <DomainModel.TicketHistory>(); var enumerator = TicketHistorys.GetEnumerator(); while (enumerator.MoveNext()) { result.Add(enumerator.Current); } return(result); }
public void DeleteTicketHistory(int TicketHistoryId) { var TicketHistory = TicketHistoryRepository.GetById(TicketHistoryId); TicketHistoryRepository.Delete(TicketHistory); }
public DomainModel.TicketHistory UpdateTicketHistory(DomainModel.TicketHistory originalTicketHistory, TicketHistoryRequest TicketHistory) { this.MergeTicketHistory(originalTicketHistory, TicketHistory); TicketHistoryRepository.Update(originalTicketHistory); return(originalTicketHistory); }