public void DeleteItem(int id) { var item = new Item(); var db = new MyDataBaseSuperMarketEntities(); db.Items.Remove(item); db.SaveChanges(); }
public void ViewAmount() { var item = new Item(); var db = new MyDataBaseSuperMarketEntities(); Item[] list = db.Items.ToArray(); var orderByAmount = from amount in list orderby amount.Amount select amount; }
public void ViewPrice() { var item = new Item(); var db = new MyDataBaseSuperMarketEntities(); Item[] list = db.Items.ToArray(); var orderByPrice = from price in list orderby price.Price select price; }
public void ViewAZ() { var item = new Item(); var db = new MyDataBaseSuperMarketEntities(); Item[] list = db.Items.ToArray(); var orderByAZ = from name in list orderby name.Name select name; }
public void UpdateItem(int id, string name, int producer, int price, int amount) { var item = new Item(); item.Name = name; item.Producer = producer; item.Amount = amount; var db = new MyDataBaseSuperMarketEntities(); db.Entry(item).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void addItem(string code, string name, int producer, int price, int amount) { var item = new Item(); item.Code = code; item.Name = name; item.Producer = producer; item.Amount = amount; var db = new MyDataBaseSuperMarketEntities(); db.Items.Add(item); db.SaveChanges(); }
public Item getItems(int id) { var db = new MyDataBaseSuperMarketEntities(); return(db.Items.Find(id)); }
public Item[] getItem() { var db = new MyDataBaseSuperMarketEntities(); return(db.Items.ToArray()); }