Exemplo n.º 1
0
        public FireExtinguisherControl CreateFireExtinguisherControl(ControlRequest FireExtinguisherControl)
        {
            var entityToInsert = new FireExtinguisherControl()
            {
            };

            MergeFireExtinguisherControl(entityToInsert, FireExtinguisherControl);
            FireExtinguisherControlRepository.Insert(entityToInsert);
            return(entityToInsert);
        }
Exemplo n.º 2
0
        public FireExtinguisherControl GetById(int FireExtinguisherControlId)
        {
            var FireExtinguisherControl = FireExtinguisherControlRepository.GetById(FireExtinguisherControlId);

            if (FireExtinguisherControl == null)
            {
                throw new BadRequestException(ErrorMessages.GastoNoEncontrado);
            }

            return(FireExtinguisherControl);
        }
Exemplo n.º 3
0
        public IList <FireExtinguisherControl> GetAll()
        {
            var FireExtinguisherControl = FireExtinguisherControlRepository.GetAll();

            if (FireExtinguisherControl == null)
            {
                throw new BadRequestException(ErrorMessages.GastoNoEncontrado);
            }

            var result     = new List <FireExtinguisherControl>();
            var enumerator = FireExtinguisherControl.GetEnumerator();

            while (enumerator.MoveNext())
            {
                result.Add(enumerator.Current);
            }
            return(result);
        }
Exemplo n.º 4
0
        public void DeleteFireExtinguisherControl(int FireExtinguisherControlId)
        {
            var FireExtinguisherControl = FireExtinguisherControlRepository.GetById(FireExtinguisherControlId);

            FireExtinguisherControlRepository.Delete(FireExtinguisherControl);
        }
Exemplo n.º 5
0
 public FireExtinguisherControl UpdateFireExtinguisherControl(FireExtinguisherControl originalFireExtinguisherControl, ControlRequest FireExtinguisherControl)
 {
     this.MergeFireExtinguisherControl(originalFireExtinguisherControl, FireExtinguisherControl);
     FireExtinguisherControlRepository.Update(originalFireExtinguisherControl);
     return(originalFireExtinguisherControl);
 }