Ejemplo n.º 1
0
        public bool Update(Mantenimiento model)
        {
            try
            {
                var result = _DbContext.Mantenimientos.Single(x =>
                                                              x.Id == model.Id);



                _DbContext.Mantenimientos.Update(model);
                _DbContext.SaveChangesAsync();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public bool Update(Empleado model)
        {
            try
            {
                var result = _DbContext.Empleados.Single(x =>
                                                         x.Id == model.Id);

                if (result == null)
                {
                    _DbContext.Empleados.Update(model);
                }
                _DbContext.SaveChangesAsync();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        public bool Update(Factura model)
        {
            try
            {
                var result = _dbContext.Facturas.Single(x =>
                                                        x.Id == model.Id);

                if (result == null)
                {
                    _dbContext.Facturas.Update(model);
                }
                _dbContext.SaveChangesAsync();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 4
0
        public bool Update(Area_Reparacion model)
        {
            try
            {
                var result = _DbContext.Area_Reparacions.Single(x =>
                                                                x.Id == model.Id);
                result.Nombre      = model.Nombre;
                result.Descripcion = model.Descripcion;


                _DbContext.Area_Reparacions.Update(result);
                _DbContext.SaveChangesAsync();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public virtual async Task Add(TEntity entity)
 {
     _dbSet.Add(entity);
     await _context.SaveChangesAsync().ConfigureAwait(false);
 }