Exemplo n.º 1
0
        public int CreateEmpleado(BusinessEntities.Empleados empleadoEntity)
        {
            using (var scope = new TransactionScope())
            {
                _unitOfWork.EmpleadosRepository.Insert(empleadoEntity);
                _unitOfWork.Save();
                scope.Complete();

                return(empleadoEntity.IdEmpleado);
            }
        }
Exemplo n.º 2
0
        public bool UpdateEmpleado(int empleadoId, BusinessEntities.Empleados empleadoEntity)
        {
            var success = false;

            if (empleadoEntity != null)
            {
                using (var scope = new TransactionScope())
                {
                    //var empleado = _unitOfWork.EmpleadosRepository.GetById(empleadoId);
                    //if (empleado != null)
                    //{
                    _unitOfWork.EmpleadosRepository.Update(empleadoEntity);
                    _unitOfWork.Save();
                    scope.Complete();
                    success = true;
                    //}
                }
            }

            return(success);
        }