Beispiel #1
0
        public IActionResult Edit(int id)
        {
            var            uredjaj     = _uredjajService.GetById(id);
            UredjajEditDto noviUredjaj = new UredjajEditDto();

            noviUredjaj.Id   = uredjaj.Id;
            noviUredjaj.Name = uredjaj.Name;

            return(View(noviUredjaj));
        }
Beispiel #2
0
        public void Update(int id, UredjajEditDto input)
        {
            var uredjaj = _uredjajRepository.Get(id);

            if (uredjaj == null)
            {
                throw new UserFriendlyException("Nepostojeci uredjaj");
            }

            ObjectMapper.Map(input, uredjaj);
        }
Beispiel #3
0
 public IActionResult Edit(int id, UredjajEditDto input)
 {
     _uredjajService.Update(id, input);
     return(RedirectToAction("GetAll"));
 }