Exemplo n.º 1
0
        //Display the list of cheeses on index page by using ViewBag and Views
        // GET: /<controller>/
        public IActionResult Index()
        {
            ViewBag.title = "My Cheese";
            List <Cheese> cheeses = CheeseData.GetAll();

            return(View(cheeses));
        }
Exemplo n.º 2
0
        public IActionResult Remove()
        {
            ViewBag.title   = "Remove Cheeses";
            ViewBag.cheeses = CheeseData.GetAll();//context.Cheeses.ToList();

            return(View());
        }
Exemplo n.º 3
0
        public IActionResult Delete()
        {
            ViewBag.cheeses = CheeseData.GetAll();
            ViewBag.title   = "Delete Cheeses";

            return(View());
        }
Exemplo n.º 4
0
        public IActionResult Remove()
        {
            ViewBag.title      = "Remove Cheese";
            ViewBag.cheeseList = CheeseData.GetAll();

            return(View());
        }
Exemplo n.º 5
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            List <Cheese> cheeses = CheeseData.GetAll();

            ViewBag.cheeses = CheeseData.GetAll();
            return(View(cheeses));
        }
Exemplo n.º 6
0
 public IActionResult Remove()
 {
     //Display form
     //needs to pass in the whole List of form(via ViewBag same one as before)
     ViewBag.cheeses = CheeseData.GetAll();//*****
     ViewBag.title   = "Remove Cheese";
     return(View());
 }
Exemplo n.º 7
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            List <Cheese> cheeses = CheeseData.GetAll();

            invalidInput = false;

            return(View(cheeses));
        }
Exemplo n.º 8
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            CheeseListViewModel model = new CheeseListViewModel {
                Cheeses = CheeseData.GetAll()
            };

            return(View(model));
        }
Exemplo n.º 9
0
        // Display the list of cheeses
        // GET: /cheese
        public IActionResult Index()
        {
            // data for the view
            List <Cheese> cheeses = CheeseData.GetAll();

            // view defaults to action name: Index.cshtml
            // /Views/Cheese/Index.cshtml
            return(View(cheeses));
        }
Exemplo n.º 10
0
 public IActionResult DeleteSelected(int[] cheeseSelect)
 {
     foreach (int cheeseId in cheeseSelect)
     {
         CheeseData.Delete(cheeseId);
     }
     ViewBag.cheeses = CheeseData.GetAll();
     return(Redirect("/Cheese"));
 }
Exemplo n.º 11
0
        //calls the index method of our cheese controller
        // GET: /<controller>/
        public IActionResult Index()
        {
            List <Cheese> cheeses = CheeseData.GetAll(); // best way to bring in Cheeses directly, without using ViewBag

            //ViewBag.Cheeses = CheeseData.GetAll();
            //ViewData["cheese"] = CheeseData.GetAll(); // same as above

            return(View(cheeses));
        }
Exemplo n.º 12
0
        public IActionResult AddEditCheeseViewModel(AddEditCheeseViewModel model)
        {
            var cheeses = CheeseData.GetAll();

            cheeses[model.cheeseId].Name        = model.Name;
            cheeses[model.cheeseId].Description = model.Description;
            cheeses[model.cheeseId].Type        = model.Type;
            cheeses[model.cheeseId].Rating      = model.Rating;
            return(Redirect("Index"));
        }
Exemplo n.º 13
0
        public IActionResult DeleteAll(string[] cheeseSelect)
        {
            List <Cheese> cheeseList = new List <Cheese>(CheeseData.GetAll());

            foreach (Cheese cheese in cheeseList)
            {
                CheeseData.Delete(cheese.CheeseId);
            }

            ViewBag.cheeses = CheeseData.GetAll();
            return(Redirect("/Cheese"));
        }
Exemplo n.º 14
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            ViewBag.cheeses = CheeseData.GetAll();

            return View();
        }
Exemplo n.º 15
0
        public IActionResult CheckBoxDelete()
        {
            List <Cheese> model = CheeseData.GetAll();

            return(View());
        }
Exemplo n.º 16
0
        public IActionResult DropDownDelete()
        {
            List <Cheese> model = CheeseData.GetAll();

            return(View(model));
        }
Exemplo n.º 17
0
 public IActionResult Remove()
 {
     ViewBag.title   = "Remove cheeses";
     ViewBag.cheeses = CheeseData.GetAll();
     return(view());
 }
 public IActionResult DeleteCheckbox()
 {
     ViewBag.title   = "Remove Cheeses with Checkboxes";
     ViewBag.cheeses = CheeseData.GetAll();
     return(View());
 }
Exemplo n.º 19
0
 public DeleteCheesesViewModel()
 {
     this.Cheeses = CheeseData.GetAll();
 }
 public IActionResult DeleteDropdownList()
 {
     ViewBag.title   = "Remove Cheeses with Dropdown List";
     ViewBag.cheeses = CheeseData.GetAll();
     return(View());
 }
Exemplo n.º 21
0
 public IActionResult Index()
 {
     return(View(CheeseData.GetAll()));
 }
Exemplo n.º 22
0
 public IActionResult Remove()
 {
     ViewBag.cheeses = CheeseData.GetAll();
     return(View());
 }
Exemplo n.º 23
0
 public IActionResult Remove()
 {
     return(View(CheeseData.GetAll()));
 }
Exemplo n.º 24
0
        public IActionResult Index()
        {
            List <Cheese> model = CheeseData.GetAll();

            return(View(model));
        }
Exemplo n.º 25
0
 public IActionResult Subtract()
 {
     ViewBag.cheeses = CheeseData.GetAll();
     return(View());
 }