public IActionResult SearchForName(string searchPhrase) { GadgetDAO gadgetDAO = new GadgetDAO(); List <GadgetModel> searchResoults = gadgetDAO.SearchForName(searchPhrase); return(View("Index", searchResoults)); }
public ActionResult SearchForDescription(string searchPhraseDescription) { GadgetDAO gadgetDAO = new GadgetDAO(); List <GadgetModel> searchResults = gadgetDAO.SearchForDescription(searchPhraseDescription); return(View("Index", searchResults)); }
public IActionResult Create(GadgetModel newModel) { GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.Create(newModel); return(View("Details", newModel)); }
public IActionResult Delete(int id) { GadgetDAO gadgetDao = new GadgetDAO(); gadgetDao.Delete(id); return(Redirect("/gadgets")); }
public ActionResult Details(int id) { GadgetDAO gadgetDAO = new GadgetDAO(); GadgetModel gadget = gadgetDAO.FetchOne(id); return(View("Details", gadget)); }
public ActionResult Edit(int id) { GadgetDAO gadgetDAO = new GadgetDAO(); GadgetModel gadget = gadgetDAO.GetGadget(id); return(View("GadgetForm", gadget)); }
public ActionResult Edit(int id) { GadgetDAO gadgetDAO = new GadgetDAO(); GadgetModel gadgets = gadgetDAO.FetchOne(id); return(View("GadgetForm", gadgets)); }
public ActionResult SearchForDescription(string searchPhrase) { //get the list of search results from the database. GadgetDAO gadgetDAO = new GadgetDAO(); List <GadgetModel> searchResults = gadgetDAO.SearchForDescription(searchPhrase); return(View("Index", searchResults)); }
public ActionResult ProcessCreate(GadgetModel gadgetModel) { GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.CreateOrUpdate(gadgetModel); return(View("Details", gadgetModel)); }
public IActionResult SearchDescription(string Description) { List <GadgetModel> gadgets = new List <GadgetModel>(); GadgetDAO gadgetDAO = new GadgetDAO(); gadgets = gadgetDAO.SearchDescription(Description); return(View("Index", gadgets)); }
public IActionResult SearchName(string Name) { List <GadgetModel> gadgets = new List <GadgetModel>(); GadgetDAO gadgetDAO = new GadgetDAO(); gadgets = gadgetDAO.SearchName(Name); return(View("Index", gadgets)); }
public IActionResult Update(GadgetModel updateModel) { //GadgetModel gadget = new GadgetModel(); GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.Update(updateModel); return(View("Details", updateModel)); }
public IActionResult Edit(int id) { GadgetModel gadget = new GadgetModel(); GadgetDAO gadgetDAO = new GadgetDAO(); gadget = gadgetDAO.fetchById(id); return(View("Edit", gadget)); }
public IActionResult Index() { GadgetDAO gadgetDAO = new GadgetDAO(); gadgets = gadgetDAO.FetchAll(); return(View("Index", gadgets)); }
public IActionResult Index() { List <GadgetModel> gadgets = new List <GadgetModel>(); // GadgetDAO gadgetDAO = new GadgetDAO(); gadgets = gadgetDAO.fetchAll(); return(View("Index", gadgets)); }
public ActionResult Delete(int id) { GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.Delete(id); List <GadgetModel> gadgets = gadgetDAO.FetchAll(); return(View("Index", gadgets)); }
//Cria um item no banco public ActionResult ProcessCreate(GadgetModel gadgetModel) { //Salvando no banco de dados GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.CreateOrUpdate(gadgetModel); return(View("Details", gadgetModel)); }
public ActionResult ProcessCreate(GadgetModel gadgetModel) { //Save to the database GadgetDAO gadgetDAO = new GadgetDAO(); gadgetDAO.CreateOrUpdateGadget(gadgetModel); return(View("Details", gadgetModel)); }
// GET: Gadgets public ActionResult Index() { //generate some fake data and send it to the view List <GadgetModel> gadgets = new List <GadgetModel>(); GadgetDAO gadgetDAO = new GadgetDAO(); gadgets = gadgetDAO.FetchAll(); return(View("Index", gadgets)); }