Esempio n. 1
0
        public IActionResult Aanpassen(long id)
        {
            KlantDetailViewModel vm = new KlantDetailViewModel();
            Klant klant             = klantrepository.GetById(id);

            vm = klantConverter.ModelToViewModel(klant);
            return(View(vm));
        }
Esempio n. 2
0
        public IActionResult Aanpassen(KlantDetailViewModel vm, long id)
        {
            string rawValue = HttpContext.User.Identities.First().Claims.First().Value;

            if (string.IsNullOrEmpty(rawValue))
            {
                return(View());
            }
            if (long.TryParse(rawValue, out id))
            {
                Klant klant = klantConverter.ViewModelToModel(vm);
                bool  check = klantrepository.Update(klant);
                return(RedirectToAction("Index", new { vm.Id }));
            }
            return(View());
        }
Esempio n. 3
0
        public IActionResult Index(long id)
        {
            string rawValue = HttpContext.User.Identities.First().Claims.First().Value;

            if (string.IsNullOrEmpty(rawValue))
            {
                return(View());
            }
            if (long.TryParse(rawValue, out id))
            {
                KlantDetailViewModel vm = new KlantDetailViewModel();
                Klant klant             = klantrepository.GetById(id);
                vm = klantConverter.ModelToViewModel(klant);
                return(View(vm));
            }
            return(View());
        }