public ElevatorControl CreateElevatorControl(ControlRequest ElevatorControl) { var entityToInsert = new ElevatorControl() { }; MergeElevatorControl(entityToInsert, ElevatorControl); ElevatorControlRepository.Insert(entityToInsert); return(entityToInsert); }
public ElevatorControl GetById(int ElevatorControlId) { var ElevatorControl = ElevatorControlRepository.GetById(ElevatorControlId); if (ElevatorControl == null) { throw new BadRequestException(ErrorMessages.GastoNoEncontrado); } return(ElevatorControl); }
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); }
public void DeleteElevatorControl(int ElevatorControlId) { var ElevatorControl = ElevatorControlRepository.GetById(ElevatorControlId); ElevatorControlRepository.Delete(ElevatorControl); }
public ElevatorControl UpdateElevatorControl(ElevatorControl originalElevatorControl, ControlRequest ElevatorControl) { this.MergeElevatorControl(originalElevatorControl, ElevatorControl); ElevatorControlRepository.Update(originalElevatorControl); return(originalElevatorControl); }