예제 #1
0
        public DomainModel.TicketHistory CreateTicketHistory(TicketHistoryRequest TicketHistory)
        {
            var entityToInsert = new DomainModel.TicketHistory()
            {
            };

            MergeTicketHistory(entityToInsert, TicketHistory);
            TicketHistoryRepository.Insert(entityToInsert);
            return(entityToInsert);
        }
예제 #2
0
        public DomainModel.TicketHistory GetById(int TicketHistoryId)
        {
            var TicketHistory = TicketHistoryRepository.GetById(TicketHistoryId);

            if (TicketHistory == null)
            {
                throw new BadRequestException(ErrorMessages.TicketHistoryNoEncontrado);
            }

            return(TicketHistory);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void DeleteTicketHistory(int TicketHistoryId)
        {
            var TicketHistory = TicketHistoryRepository.GetById(TicketHistoryId);

            TicketHistoryRepository.Delete(TicketHistory);
        }
예제 #5
0
 public DomainModel.TicketHistory UpdateTicketHistory(DomainModel.TicketHistory originalTicketHistory, TicketHistoryRequest TicketHistory)
 {
     this.MergeTicketHistory(originalTicketHistory, TicketHistory);
     TicketHistoryRepository.Update(originalTicketHistory);
     return(originalTicketHistory);
 }