Beispiel #1
0
        // GET: Bestillling
        public ActionResult ListAlleBestillinger()
        {//gjort
            /*///////var db = new Models.BestillingContext();////////*/

            //*******1******

            /*var bestillinger = db.Bestillinger.ToList();
             * var bes = new List<int>();
             * foreach(var b in bestillinger)
             * {
             *  if (!bes.Contains(b.ordreID))
             *  {
             *      bes.Add(b.ordreID);
             *  }
             *  return View(bes);
             * }*/
            //*********************

            /*/////////
            *  List<Models.Bestilling> listeAvBrukere = db.Bestillinger.ToList();
            *  //ViewData.Model = listeAvBrukere;
            *  ViewData["Melding"] = "Velg noe her: ";
            *  //return View();
            *  //List<Models.Vare> listeAvBestillinger = db.Varer.ToList();
            *  List<Models.Bestilling> listeAvBestillinger = db.Bestillinger.ToList();
            *  return View(listeAvBestillinger);
            *  /////////*/

            var BLL = new BLL.BestillingBLL();
            List <Bestilling> listeAvBestillinger = BLL.ListAlleBestillinger();

            return(View(listeAvBestillinger));
        }
        // GET: Bestillling
        public ActionResult ListAlleBestillinger()
        {
            //gjort
             /*///////var db = new Models.BestillingContext();////////*/

            //*******1******
            /*var bestillinger = db.Bestillinger.ToList();
            var bes = new List<int>();
            foreach(var b in bestillinger)
            {
                if (!bes.Contains(b.ordreID))
                {
                    bes.Add(b.ordreID);
                }
                return View(bes);
            }*/
            //*********************

            /*/////////
             List<Models.Bestilling> listeAvBrukere = db.Bestillinger.ToList();
             //ViewData.Model = listeAvBrukere;
             ViewData["Melding"] = "Velg noe her: ";
             //return View();
            //List<Models.Vare> listeAvBestillinger = db.Varer.ToList();
            List<Models.Bestilling> listeAvBestillinger = db.Bestillinger.ToList();
            return View(listeAvBestillinger);
            /////////*/

            var BLL = new BLL.BestillingBLL();
            List<Bestilling> listeAvBestillinger = BLL.ListAlleBestillinger();
            return View(listeAvBestillinger);
        }