public static bool Eliminar(int id) { try { using (var db = new SistemaVentasDb()) { TipoUsuarios t = new TipoUsuarios(); t = db.TipoUsuarios.Find(id); db.TipoUsuarios.Remove(t); db.SaveChanges(); db.Dispose(); return(false); } } catch (Exception) { return(true); throw; } }
public static bool Eliminar(int id) { try { using (var db = new SistemaVentasDb()) { CondicionPagos cps = new CondicionPagos(); cps = db.CodicionPagos.Find(id); db.CodicionPagos.Remove(cps); db.SaveChanges(); db.Dispose(); return(false); } } catch (Exception) { return(true); throw; } }
public static bool Eliminar(int id) { //bool retorna = false; try { using (var db = new SistemaVentasDb()) { Usuarios us = new Usuarios(); us = db.Usuarios.Find(id); db.Usuarios.Remove(us); db.SaveChanges(); db.Dispose(); return(false); } } catch (Exception) { return(true); throw; } }
public static bool Insertar(Empleados e) { //bool retorna = false; try { using (var db = new SistemaVentasDb()) { db.Empleados.Add(e); db.SaveChanges(); db.Dispose(); //retorna = true; return(true); } } catch (Exception) { return(false); throw; } // return retorna; }