public ConsortiumSecure GetById(int ConsortiumSecureId) { var ConsortiumSecure = ConsortiumSecureRepository.GetById(ConsortiumSecureId); if (ConsortiumSecure == null) { throw new BadRequestException(ErrorMessages.ConsorcioNoEncontrado); } return(ConsortiumSecure); }
public ConsortiumSecure CreateConsortiumSecure(ConsortiumSecureRequest ConsortiumSecure) { var entityToInsert = new ConsortiumSecure() { Brand = ConsortiumSecure.Brand, Consortium = this.ConsortiumRepository.GetById(ConsortiumSecure.ConsortiumId), LimitDate = ConsortiumSecure.LimitDate, PolizyNumber = ConsortiumSecure.PolizyNumber, Status = this.SecureStatusRepository.GetById(ConsortiumSecure.SecureStatusId) }; ConsortiumSecureRepository.Insert(entityToInsert); return(entityToInsert); }
public List <ConsortiumSecure> GetAll() { var secure = ConsortiumSecureRepository.GetAll(); if (secure == null) { throw new BadRequestException(ErrorMessages.UserNoEncontrado); } var result = new List <ConsortiumSecure>(); var enumerator = secure.GetEnumerator(); while (enumerator.MoveNext()) { result.Add(enumerator.Current); } return(result); }
public void DeleteConsortiumSecure(int ConsortiumSecureId) { var ConsortiumSecure = ConsortiumSecureRepository.GetById(ConsortiumSecureId); ConsortiumSecureRepository.Delete(ConsortiumSecure); }
public ConsortiumSecure UpdateConsortiumSecure(ConsortiumSecure originalConsortiumSecure, ConsortiumSecureRequest ConsortiumSecure) { this.MergeConsortiumSecure(originalConsortiumSecure, ConsortiumSecure); ConsortiumSecureRepository.Update(originalConsortiumSecure); return(originalConsortiumSecure); }
public List <ConsortiumSecure> GetAll() { return(ConsortiumSecureRepository.GetAll().ToList()); }