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));
        }
예제 #3
0
        public IActionResult Create(GadgetModel newModel)
        {
            GadgetDAO gadgetDAO = new GadgetDAO();

            gadgetDAO.Create(newModel);
            return(View("Details", newModel));
        }
예제 #4
0
        public IActionResult Delete(int id)
        {
            GadgetDAO gadgetDao = new GadgetDAO();

            gadgetDao.Delete(id);
            return(Redirect("/gadgets"));
        }
예제 #5
0
        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));
        }
예제 #7
0
        public ActionResult Edit(int id)
        {
            GadgetDAO   gadgetDAO = new GadgetDAO();
            GadgetModel gadgets   = gadgetDAO.FetchOne(id);

            return(View("GadgetForm", gadgets));
        }
예제 #8
0
        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));
        }
예제 #9
0
        public ActionResult ProcessCreate(GadgetModel gadgetModel)
        {
            GadgetDAO gadgetDAO = new GadgetDAO();

            gadgetDAO.CreateOrUpdate(gadgetModel);

            return(View("Details", gadgetModel));
        }
예제 #10
0
        public IActionResult SearchDescription(string Description)
        {
            List <GadgetModel> gadgets   = new List <GadgetModel>();
            GadgetDAO          gadgetDAO = new GadgetDAO();

            gadgets = gadgetDAO.SearchDescription(Description);
            return(View("Index", gadgets));
        }
예제 #11
0
        public IActionResult SearchName(string Name)
        {
            List <GadgetModel> gadgets   = new List <GadgetModel>();
            GadgetDAO          gadgetDAO = new GadgetDAO();

            gadgets = gadgetDAO.SearchName(Name);
            return(View("Index", gadgets));
        }
예제 #12
0
        public IActionResult Update(GadgetModel updateModel)
        {
            //GadgetModel gadget = new GadgetModel();
            GadgetDAO gadgetDAO = new GadgetDAO();

            gadgetDAO.Update(updateModel);
            return(View("Details", updateModel));
        }
예제 #13
0
        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));
        }
예제 #15
0
        public IActionResult Index()
        {
            List <GadgetModel> gadgets = new List <GadgetModel>();
            //
            GadgetDAO gadgetDAO = new GadgetDAO();

            gadgets = gadgetDAO.fetchAll();
            return(View("Index", gadgets));
        }
예제 #16
0
        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));
        }
예제 #19
0
        // 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));
        }