public void Actualizar(Empresa Emp) { try { using (var ctx = new DbTeam()) { ctx.Entry(Emp).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Actualizar(UsuarioPermiso Usr) { try { using (var ctx = new DbTeam()) { ctx.Entry(Usr).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Guardar(UsuarioPermiso Usr) { try { using (var ctx = new DbTeam()) { ctx.UsuarioPermiso.Add(Usr); ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Eliminar(int id) { try { using (var ctx = new DbTeam()) { var vEmpresa = ctx.Empresa.Where(x => x.Emp_id == id).SingleOrDefault(); ctx.Empresa.Remove(vEmpresa); ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Eliminar(int id) { try { using (var ctx = new DbTeam()) { var vBase = ctx.Usuario.Where(x => x.Us_Id == id).SingleOrDefault(); ctx.Usuario.Remove(vBase); ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Actualizar(Usuario Usr) { try { Usr.Us_Password = M_Seguridad.Encriptar(Usr.Us_Password.Trim()); using (var ctx = new DbTeam()) { ctx.Entry(Usr).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Guardar(Empresa Emp) { try { using (var ctx = new DbTeam()) { if (ctx.Empresa.Count() == 0) { Emp.Emp_id = 1; } else { Emp.Emp_id = ctx.Empresa.Max(x => x.Emp_id) + 1; } ctx.Empresa.Add(Emp); ctx.SaveChanges(); } } catch (Exception) { throw; } }
public void Guardar(Usuario Usr) { try { Usr.Us_Password = M_Seguridad.Encriptar(Usr.Us_Password); using (var ctx = new DbTeam()) { if (ctx.Usuario.Count() == 0) { Usr.Us_Id = 1; } else { Usr.Us_Id = ctx.Usuario.Max(x => x.Us_Id) + 1; } ctx.Usuario.Add(Usr); ctx.SaveChanges(); } } catch (Exception) { throw; } }