示例#1
0
        public ActionResult Edit(UlogaViewModel1 vm)
        {
            try
            {
                OpUlogaUpdate op = new OpUlogaUpdate();
                op.dto.id_uloga = vm.id;
                op.dto.naziv    = vm.naziv;
                ResultOperation res = manager.ExecuteOperation(op);
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
示例#2
0
        // GET: Admin/Uloga/Edit/5
        public ActionResult Edit(string id)
        {
            UlogaDto dto = new UlogaDto()
            {
                id_uloga = id
            };
            OpUlogaGetOne op = new OpUlogaGetOne();

            op.dto = dto;
            ResultOperation res   = manager.ExecuteOperation(op);
            UlogaDto        uloga = res.items[0] as UlogaDto;
            UlogaViewModel1 vm    = new UlogaViewModel1()
            {
                id    = uloga.id_uloga,
                naziv = uloga.naziv
            };

            return(View(vm));
        }
示例#3
0
        public ActionResult Create(UlogaViewModel1 vm)
        {
            try
            {
                UlogaDto dto = new UlogaDto()
                {
                    id_uloga = Guid.NewGuid().ToString(),
                    naziv    = vm.naziv
                };
                OpUlogaInsert op = new OpUlogaInsert();
                op.dto = dto;
                ResultOperation res = manager.ExecuteOperation(op);
                // TODO: Add insert logic here

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