public static bool Modificar(int id, CondicionPagos cps) { bool retorno = false; try { using (var db = new SistemaVentasDb()) { CondicionPagos cp = db.CodicionPagos.Find(id); cp.Descripcion = cps.Descripcion; db.SaveChanges(); } retorno = true; } catch (Exception) { throw; } return(retorno); }
public static bool Insertar(CondicionPagos c) { bool retorna = false; try { using (var db = new SistemaVentasDb()) { db.CodicionPagos.Add(c); db.SaveChanges(); //db.Dispose(); retorna = true; } } catch (Exception) { throw; } return(retorna); }
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; } }