public int Delete(int id) { int ret = 0; using (var superStores = new SuperZapatosEntities2()) { SuperZEnt.Stores art = superStores.Stores.First(x => x.id == id); superStores.Stores.Remove(art); ret = superStores.SaveChanges(); } return(ret); }
public int Edit(SuperZEnt.Stores store) { int ret = 0; using (var superStores = new SuperZapatosEntities2()) { SuperZEnt.Stores art = superStores.Stores.First(x => x.id == store.id); art.id = store.id; art.name = store.name; art.address = store.address; ret = superStores.SaveChanges(); } return(ret); }
public int Save(SuperZEnt.Stores store) { int ret = 0; using (var superStores = new SuperZapatosEntities2()) { var stor = superStores.Stores .Where(b => b.id == store.id) .FirstOrDefault(); if (stor == null) { superStores.Stores.Add(store); ret = superStores.SaveChanges(); } else { ret = -1; } } return(ret); }
public bool DeleteStore(SuperZEnt.Stores article) { IStoresClass art = new StoresClass(); return(art.Delete(article.id) > 0 ? true : false); }
public bool EditStore(SuperZEnt.Stores article) { IStoresClass art = new StoresClass(); return(art.Edit(article) > 0 ? true : false); }
public int SaveStore(SuperZEnt.Stores article) { IStoresClass art = new StoresClass(); return(art.Save(article)); }