コード例 #1
0
        public ConsortiumSecure GetById(int ConsortiumSecureId)
        {
            var ConsortiumSecure = ConsortiumSecureRepository.GetById(ConsortiumSecureId);

            if (ConsortiumSecure == null)
            {
                throw new BadRequestException(ErrorMessages.ConsorcioNoEncontrado);
            }

            return(ConsortiumSecure);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void DeleteConsortiumSecure(int ConsortiumSecureId)
        {
            var ConsortiumSecure = ConsortiumSecureRepository.GetById(ConsortiumSecureId);

            ConsortiumSecureRepository.Delete(ConsortiumSecure);
        }
コード例 #5
0
 public ConsortiumSecure UpdateConsortiumSecure(ConsortiumSecure originalConsortiumSecure, ConsortiumSecureRequest ConsortiumSecure)
 {
     this.MergeConsortiumSecure(originalConsortiumSecure, ConsortiumSecure);
     ConsortiumSecureRepository.Update(originalConsortiumSecure);
     return(originalConsortiumSecure);
 }
コード例 #6
0
 public List <ConsortiumSecure> GetAll()
 {
     return(ConsortiumSecureRepository.GetAll().ToList());
 }