public ActionResult EditUser(FormCollection form) { int boss = 0; if (form["userIsBoss"] != null) { boss = Int32.Parse(form["userIsBoss"]); } String name = form["userName"]; String Actualdep = form["dep"]; String newDep = form["userDepartment"]; int idlog = Int32.Parse(form["idLog"]); String email = form["userEmail"]; con.updateEmail(email, idlog); if (Actualdep.Equals(newDep)) { if (Actualdep.Equals("Plataforma")) { con.updatePlataforma(name, boss, idlog); } else { con.updateSecretary(name, newDep, idlog); } } else { if (Actualdep.Equals("Plataforma")) { con.moveToDepartment(name, newDep, idlog, email); } else if (!Actualdep.Equals("Plataforma")) { if (newDep.Equals("Plataforma")) { con.moveToPlatformer(name, boss, idlog, email); } else { con.updateSecretary(name, newDep, idlog); } } } return(RedirectToAction("UserList", "Administrator")); }