public void Delete(int id) { using (var ctx = new Context.Context()) { var usuario = ctx.Usuarios.Find(id); if (usuario != null) { usuario.ConfirmacaoSenha = usuario.Senha; usuario.DataExclusao = DateTime.Now; ctx.Entry(usuario).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); var responsavel = ctx.Responsaveis.Where(x => x.DataExclusao == null && x.UsuarioID == usuario.ID).SingleOrDefault(); if (responsavel != null) { responsavel.UsuarioID = null; ctx.Entry(responsavel).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } } }
public virtual void Delete(TEntity entityToDelete) { if (_context.Entry(entityToDelete).State == EntityState.Detached) { _dbSet.Attach(entityToDelete); } _context.Entry(entityToDelete).State = EntityState.Deleted; _dbSet.Remove(entityToDelete); }
public async Task <TEntity> Update(TEntity entity) { _context.Entry(entity).State = EntityState.Modified; await _context.SaveChangesAsync(); return(entity); }
public void Update(int perfilID, string funcionalidade, string metodo) { using (var ctx = new Context.Context()) { var permissoes = ctx.Permissoes.Where(x => x.PerfilID == perfilID).ToList(); var permissao = permissoes.Where(x => x.Funcionalidade.Nome.ToLower() == funcionalidade.ToLower() && x.Metodos.ToLower().Contains(metodo.ToLower())).FirstOrDefault(); List <string> metodos = permissao.Metodos.Split(',').ToList(); if (permissao == null) { metodos.Add(metodo.ToUpper()); } else { metodos = metodos.Where(x => x != metodo.ToUpper()).ToList(); } permissao.Metodos = string.Join(",", metodos); ctx.Entry(permissao).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Placa placa) { using (var ctx = new Context.Context()) { ctx.Entry(placa).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(OrdemServico ordemServico) { using (var ctx = new Context.Context()) { ctx.Entry(ordemServico).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(PropriedadeValor propriedadeValor) { using (var ctx = new Context.Context()) { ctx.Entry(propriedadeValor).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Sincronizacao sincronizacao) { using (var ctx = new Context.Context()) { ctx.Entry(sincronizacao).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Filial filial) { using (var ctx = new Context.Context()) { ctx.Entry(filial).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(InventarioConfig config) { using (var ctx = new Context.Context()) { ctx.Entry(config).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Upload upload) { using (var ctx = new Context.Context()) { ctx.Entry(upload).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(CentroCusto centroCusto) { using (var ctx = new Context.Context()) { ctx.Entry(centroCusto).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Responsavel resp) { using (var ctx = new Context.Context()) { ctx.Entry(resp).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Especie especie) { using (var ctx = new Context.Context()) { ctx.Entry(especie).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Update(Coletor coletor) { using (var ctx = new Context.Context()) { ctx.Entry(coletor).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public ActionResult Edit([Bind(Include = "RegionId,Nom,Description")] Region region) { if (ModelState.IsValid) { db.Entry(region).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(region)); }
public T Edit(T myObj) { if (!IsAttached(myObj)) { var obj = DbSet.Attach(myObj); myObj = obj; } Db.Entry(myObj).State = EntityState.Modified; return(myObj); }
public void Delete(int id) { using (var ctx = new Context.Context()) { var especie = ctx.Especies.Find(id); if (especie != null) { especie.DataExclusao = DateTime.Now; ctx.Entry(especie).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var centroCusto = ctx.CentrosCusto.Find(id); if (centroCusto != null) { centroCusto.DataExclusao = DateTime.Now; ctx.Entry(centroCusto).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var coletor = ctx.Coletores.Find(id); if (coletor != null) { coletor.DataExclusao = DateTime.Now; ctx.Entry(coletor).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var filial = ctx.Filiais.Find(id); if (filial != null) { filial.DataExclusao = DateTime.Now; ctx.Entry(filial).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var resp = ctx.PropriedadeValores.Find(id); if (resp != null) { resp.DataExclusao = DateTime.Now; ctx.Entry(resp).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var inventarioUsuario = ctx.InventarioUsuarios.Find(id); if (inventarioUsuario != null) { inventarioUsuario.DataExclusao = DateTime.Now; ctx.Entry(inventarioUsuario).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var grupo = ctx.Grupos.Find(id); if (grupo != null) { grupo.DataExclusao = DateTime.Now; ctx.Entry(grupo).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var placa = ctx.Placas.Find(id); if (placa != null) { placa.DataExclusao = DateTime.Now; } ctx.Entry(placa).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } }
public void Delete(int id) { using (var ctx = new Context.Context()) { var item = ctx.Itens.Find(id); if (item != null) { item.DataExclusao = DateTime.Now; ctx.Entry(item).State = System.Data.Entity.EntityState.Modified; ctx.SaveChanges(); } } }
public async Task <T> UpdateAsync(T item) { try { var result = await _dataSet.SingleOrDefaultAsync(c => c.Id.Equals(item.Id)); if (result == null) { return(null); } item.UpdateAt = DateTime.UtcNow; item.CreateAt = result.CreateAt; _context.Entry(result).CurrentValues.SetValues(item); await _context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } return(item); }
public void UpdateArtist(Artists artist) { context.Entry(artist).State = EntityState.Modified; }
public void UpdateAppLogs(AppLogs log) { context.Entry(log).State = EntityState.Modified; }
public void Update(TEntity entity) { ctx.Entry(entity).State = System.Data.Entity.EntityState.Modified; }