public static bool Modificar(Articulos Art) { bool paso = false; try { ContextoArt dbase = new ContextoArt(); dbase.Entry(Art).State = EntityState.Modified; dbase.SaveChanges(); paso = true; } catch (Exception) { throw; } return(paso); }
public static bool Eliminar(int Id) { bool paso = false; try { ContextoArt dbase = new ContextoArt(); Articulos Art = dbase.Art.Find(Id); dbase.Art.Remove(Art); dbase.SaveChanges(); paso = true; } catch (Exception) { throw; } return(paso); }
public static bool Guardar(Articulos Ar) { bool paso = false; try { ContextoArt dbase = new ContextoArt(); dbase.Art.Add(Ar); dbase.SaveChanges(); Arti = Ar; paso = true; } catch (Exception) { throw; } return(paso); }