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

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

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

            return(FireExtinguisherControl);
        }
Esempio 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);
        }
Esempio n. 4
0
        public void DeleteFireExtinguisherControl(int FireExtinguisherControlId)
        {
            var FireExtinguisherControl = FireExtinguisherControlRepository.GetById(FireExtinguisherControlId);

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