public static bool Insertar(Articulos a) { bool resultado = false; using (var Conn = new FSVentasCoreDb()) { try { var p = Buscar(a.ArticuloId); if (p == null) { Conn.Articulos.Add(a); } else { Conn.Entry(a).State = EntityState.Modified; } Conn.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Insertar(CategoriasArticulos ca) { bool resultado = false; using (var db = new FSVentasCoreDb()) { try { var p = Buscar(ca.CategoriaId); if (p == null) { db.CategoriasArticulos.Add(ca); } else { db.Entry(ca).State = EntityState.Modified; } db.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Insertar(TipoUsuarios a) { bool resultado = false; using (var db = new FSVentasCoreDb()) { try { var p = Buscar(a.TipoId); if (p == null) { db.TipoUsuarios.Add(a); } else { db.Entry(a).State = EntityState.Modified; } db.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Eliminar(Articulos nuevo) { bool resultado = false; using (var Conn = new FSVentasCoreDb()) { try { Conn.Entry(nuevo).State = EntityState.Deleted; Conn.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Eliminar(CategoriasArticulos ca) { bool resultado = false; using (var db = new FSVentasCoreDb()) { try { db.Entry(ca).State = EntityState.Deleted; db.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Eliminar(TipoUsuarios t) { bool resultado = false; using (var db = new FSVentasCoreDb()) { try { db.Entry(t).State = EntityState.Deleted; db.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }