コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["rol"] != null)
            {
                int rol = int.Parse((string)Session["rol"]);

                switch (rol)
                {
                case 1:

                    string nombreUsuario = string.Empty;
                    string rolUsuario    = string.Empty;

                    string logIn    = (string)Session["Cuenta"];
                    string Password = (string)Session["Contraseña"];

                    proxyAuthent = new AuthenticationServiceClient("WSHttpBinding_IAuthenticationService");
                    UserID       = proxyAuthent.GetID(logIn, Password);

                    if (UserID != 0)
                    {
                        nombreUsuario    = proxyAuthent.GetPerson(UserID);
                        rolUsuario       = proxyAuthent.GetRole(1);
                        lbl_welcome.Text = rolUsuario + ":  " + nombreUsuario + " ";
                        Session["value"] = "false";
                        //Session["DocenteModulo"] = "deshabilitado";
                    }
                    else
                    {
                        Response.Redirect("Authentication.aspx");
                    }

                    break;

                case 2:

                    break;

                case 3:
                    Response.Redirect("MenuDocente.aspx");
                    break;

                case 4:
                    Response.Redirect("CalificacionesEstudiante.aspx");
                    break;
                }
            }
            else
            {
                Response.Redirect("Authentication.aspx");
            }
        }