Пример #1
0
        public ElevatorControl CreateElevatorControl(ControlRequest ElevatorControl)
        {
            var entityToInsert = new ElevatorControl()
            {
            };

            MergeElevatorControl(entityToInsert, ElevatorControl);
            ElevatorControlRepository.Insert(entityToInsert);
            return(entityToInsert);
        }
Пример #2
0
        public ElevatorControl GetById(int ElevatorControlId)
        {
            var ElevatorControl = ElevatorControlRepository.GetById(ElevatorControlId);

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

            return(ElevatorControl);
        }
Пример #3
0
        public IList <ElevatorControl> GetAll()
        {
            var ElevatorControl = ElevatorControlRepository.GetAll();

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

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

            while (enumerator.MoveNext())
            {
                result.Add(enumerator.Current);
            }
            return(result);
        }
Пример #4
0
        public void DeleteElevatorControl(int ElevatorControlId)
        {
            var ElevatorControl = ElevatorControlRepository.GetById(ElevatorControlId);

            ElevatorControlRepository.Delete(ElevatorControl);
        }
Пример #5
0
 public ElevatorControl UpdateElevatorControl(ElevatorControl originalElevatorControl, ControlRequest ElevatorControl)
 {
     this.MergeElevatorControl(originalElevatorControl, ElevatorControl);
     ElevatorControlRepository.Update(originalElevatorControl);
     return(originalElevatorControl);
 }