示例#1
0
        protected void ConnexionButton_Click(object sender, EventArgs e)
        {
            DaoClient daoClient = new DaoClient();
            bool      isError   = false;
            string    errorMsg  = "";

            try
            {
                Client client = daoClient.GetClient(login.Text, password.Text);
                if (client != null)
                {
                    Session[Constants.SESSION_CLIENT] = client;
                    Response.Redirect("Profil.aspx");
                }
            }
            catch (Exception ex)
            {
                isError  = true;
                errorMsg = ex.Message;
            }

            if (isError)
            {
                connexionError.Text = "<div class=\"alert alert-warning\">" + errorMsg + "</div>";
            }

            else
            {
                connexionError.Text = "<div class =\"alert alert-danger\">Identifiant ou mot de passe incorrect</div>";
            }
        }
示例#2
0
        protected void btnValider_Click(object sender, EventArgs e)
        {
            string login    = this.txtLogin.Text;
            string password = this.txtPassword.Text;

            DaoClient daoClient = new DaoClient();
            Client    client    = daoClient.GetClient(login, password);

            if (client != null)
            {
                Session["client"] = client;
                //this.lblMessage.Text = "<div class=\"alert alert-danger\" role=\"alert\">OK</div>";
                Response.Redirect("/EspaceClient/Compte.aspx");
            }
            else
            {
                this.lblMessage.Text = "<div class=\"alert alert-danger\" role=\"alert\">Veuillez crée un compte !</div>";
            }
        }