Пример #1
0
        // GET: Admin/Korisnici/Edit/5
        public ActionResult Edit(string id)
        {
            OpKorisniciGetOne op = new OpKorisniciGetOne();

            op.dto.id = id;
            ResultOperation   res      = manager.ExecuteOperation(op);
            KorisnikViewModel vm       = new KorisnikViewModel();
            KorisniciDto      korisnik = res.items[0] as KorisniciDto;

            vm.id       = korisnik.id;
            vm.username = korisnik.username;
            vm.email    = korisnik.email;
            return(View(vm));
        }
Пример #2
0
        // GET: Admin/Korisnici/Delete/5



        public ActionResult Delete(string id)
        {
            try
            {
                KorisniciDto dto = new KorisniciDto()
                {
                    id = id
                };
                OpKorisnikDelete op = new OpKorisnikDelete();
                op.dto = dto;
                ResultOperation res = manager.ExecuteOperation(op);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #3
0
        public ActionResult Edit(KorisnikViewModel vm)
        {
            try
            {
                KorisniciDto dto = new KorisniciDto()
                {
                    email    = vm.email,
                    id       = vm.id,
                    username = vm.username
                };
                OpKorisnikUpdate op = new OpKorisnikUpdate();
                op.dto = dto;
                ResultOperation res = manager.ExecuteOperation(op);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }