Beispiel #1
0
        //
        // GET: /Pais/Edit/5

        public ActionResult Edit(int id)
        {
            PaisCtl ctl  = new PaisCtl();
            Pais    pais = ctl.BuscaPorId(id);

            return(View(pais));
        }
Beispiel #2
0
        public ActionResult Edit(int id, Pais model)
        {
            try
            {
                PaisCtl ctl  = new PaisCtl();
                Pais    pais = ctl.BuscaPorId(id);

                if (ModelState.IsValid)
                {
                    pais = model;
                    ctl.SalvarAlteracoes();
                }

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