Esempio n. 1
0
        public IActionResult Klant(int id)
        {
            Klant          klant      = klantContainer.GetByID(id);
            KlantViewModel klantModel = KlantMapper.KlantViewModelWithOrders(klant);

            return(View(klantModel));
        }
Esempio n. 2
0
        public IActionResult Create(KlantViewModel klantModel)
        {
            Klant newKlant = KlantMapper.Klant(klantModel);

            klantContainer.AddNew(newKlant);


            List <KlantViewModel> klantViewModels = KlantMapper.AllKlantViewModels();

            return(RedirectToAction("Index", klantViewModels));
        }
Esempio n. 3
0
        public IActionResult Edit(KlantViewModel klantModel)
        {
            Klant klant = KlantMapper.Klant(klantModel);

            klant.Update();

            klant      = klantContainer.GetByID(klant.id);
            klantModel = KlantMapper.KlantViewModelWithOrders(klant);

            return(RedirectToAction("Klant", klantModel));
        }
Esempio n. 4
0
 public KlantDataService()
 {
     _context     = new StomerijBasiliekEntities();
     _klantMapper = new KlantMapper();
 }
Esempio n. 5
0
        public IActionResult Index()
        {
            List <KlantViewModel> klantViewModels = KlantMapper.AllKlantViewModels();

            return(View(klantViewModels));
        }