Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            //PRV_GRUPO pRV_GRUPO = db.PRV_GRUPO.Find(id);
            //db.PRV_GRUPO.Remove(pRV_GRUPO);
            //db.SaveChanges();
            PRV_GRUPO pRV_GRUPO = repGrupo.Find(id);

            repGrupo.Excluir(g => g == pRV_GRUPO);
            repGrupo.SalvarTodos();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "PRV_ID_GRUPO,PRV_NOME_GRUPO")] PRV_GRUPO pRV_GRUPO)
 {
     if (ModelState.IsValid)
     {
         //db.Entry(pRV_GRUPO).State = EntityState.Modified;
         //db.SaveChanges();
         repGrupo.Atualizar(pRV_GRUPO);
         repGrupo.SalvarTodos();
         return(RedirectToAction("Index"));
     }
     return(View(pRV_GRUPO));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "PRV_ID_GRUPO,PRV_NOME_GRUPO")] PRV_GRUPO pRV_GRUPO)
        {
            if (ModelState.IsValid)
            {
                //db.PRV_GRUPO.Add(pRV_GRUPO);
                //db.SaveChanges();
                repGrupo.Adicionar(pRV_GRUPO);
                repGrupo.SalvarTodos();
                return(RedirectToAction("Index"));
            }

            return(View(pRV_GRUPO));
        }
Example #4
0
        // GET: PRV_GRUPO/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //PRV_GRUPO pRV_GRUPO = db.PRV_GRUPO.Find(id);
            PRV_GRUPO pRV_GRUPO = repGrupo.Find(id);

            if (pRV_GRUPO == null)
            {
                return(HttpNotFound());
            }
            return(View(pRV_GRUPO));
        }