Exemplo n.º 1
0
        public ActionResult VisViewModel()
        {
            if (!CheckSession())
            {
                return(RedirectToAction("IngenTilgang", "Admin"));
            }
            DbModel VM = new DbModel();

            try
            {
                var dbRuter        = new RuteBLL();
                var dbFlymaskiner  = new FlymaskinBLL();
                var dbFlyplasser   = new FlyplassBLL();
                var dbKunder       = new KundeBLL();
                var dbPoststeder   = new PoststedBLL();
                var dbBestillinger = new BestillingBLL();
                var dbBrukere      = new BrukerBLL();

                VM.Ruter        = dbRuter.alleRuter();
                VM.Flymaskiner  = dbFlymaskiner.alleFlymaskiner();
                VM.Flyplasser   = dbFlyplasser.alleFlyplasser();
                VM.Kunder       = dbKunder.alleKunder();
                VM.Poststeder   = dbPoststeder.allePoststeder();
                VM.Bestillinger = dbBestillinger.alleBestillinger();
                VM.Brukere      = dbBrukere.alleBrukere();
                return(View(VM));
            }
            catch (Exception ex)
            {
                LogError(ex);
                return(View("~/Views/Error/Error.cshtml"));
            }
        }
Exemplo n.º 2
0
        public ActionResult DetailsPoststeder(string id)
        {
            if (loginCheck() == false)
            {
                return(RedirectToAction("LoggInn"));
            }
            var      PoststedDb  = new PoststedBLL();
            Poststed ettPoststed = PoststedDb.getSinglePoststed(id);

            return(View(ettPoststed));
        }
Exemplo n.º 3
0
        ///POSTSTEDER////
        public ActionResult ListPoststeder()
        {
            if (loginCheck() == false)
            {
                return(RedirectToAction("LoggInn"));
            }
            var             PoststedDb     = new PoststedBLL();
            List <Poststed> allePoststeder = PoststedDb.getAll();

            return(View(allePoststeder));
        }
Exemplo n.º 4
0
        public ActionResult DeletePoststed(string id, Poststed slettPoststed)
        {
            if (loginCheck() == false)
            {
                return(RedirectToAction("LoggInn"));
            }
            var  PoststedDb = new PoststedBLL();
            bool slettOK    = PoststedDb.deletePoststed(id);

            if (slettOK)
            {
                return(RedirectToAction("ListPoststeder"));
            }
            return(View());
        }