public ActionResult About() { GroceriesEntities ORM = new GroceriesEntities(); List <Item> listofItems = ORM.Items.ToList(); //select * from customers ViewBag.Message = "Your application description page."; ViewBag.Clist = listofItems; return(View()); }
public ActionResult DeleteItem(string itemID) { GroceriesEntities GroceriesDB = new GroceriesEntities(); Item e = GroceriesDB.Items.Find(itemID); GroceriesDB.Items.Remove(e); GroceriesDB.SaveChanges(); return(RedirectToAction("About")); }
public ActionResult NewItem(Item Newitems) { GroceriesEntities GroceriesDB = new GroceriesEntities(); //este metodo es para mostrar en el view que se llama new employye para que display los datos del new employee GroceriesDB.Items.Add(Newitems); // saves the new employee to the list GroceriesDB.SaveChanges(); //saves the new employee to the db return(RedirectToAction("About")); }
public ProduceController(GroceriesEntities db) { _db = db; }
public CartController(GroceriesEntities db, CustomerController customerController) { _db = db; _customerController = customerController; }
public CustomerController(GroceriesEntities db) { _db = db; }
public CheckoutController(GroceriesEntities db) { _db = db; }