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