public ActionResult Edit(PermisosModel model, string submitButton) { if (Session["User"] != null) { Service1Client client = new Service1Client(); switch (submitButton) { case "Buscar": var hola = client.getPermiso(model.id); if (hola == null) { client.Close(); return RedirectToAction("Login", "Home"); } ViewBag.Desc = hola.descripcion; break; case "Modificar": if (ModelState.IsValid) { client.editPermiso(model.id, model.descripcion, model.activo); } break; } client.Close(); return View(); } else { return RedirectToAction("Login", "Home"); } }
public ActionResult Cargar(PermisosModel model) { if (Session["User"] != null) { if (ModelState.IsValid) { Service1Client client = new Service1Client(); var dic = client.getPermiso(model.id); client.Close(); return View(dic); } return View(); } else return RedirectToAction("Login", "Home"); }