protected void btnLogin_Click(object sender, EventArgs e)
    {
        FanLoginService.FanLoginServiceClient fls = new FanLoginService.FanLoginServiceClient();
        int id = fls.Login(txtUsername.Text, txtPassword.Text);

        if (id != 0)
        {
            Session["id"] = id;
            Response.Redirect("FanPage.aspx");
        }
        else
        {
            lblMessage.Text = "Invalid login";
        }
    }
Exemple #2
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        FanLoginService.FanLoginServiceClient fls = new FanLoginService.FanLoginServiceClient();

        FanLoginService.Fan f = new FanLoginService.Fan();
        f.FanName        = txtName.Text;
        f.FanEmail       = txtEmail.Text;
        f.FanDateEntered = DateTime.Now;

        FanLoginService.FanLogin fl = new FanLoginService.FanLogin();
        fl.FanLoginUserName      = txtUsername.Text;
        fl.FanLoginPasswordPlain = txtConfPassword.Text;

        bool result = fls.Register(f, fl);

        if (result)
        {
            lblMessage.Text = "You have successfully registered";
        }
        else
        {
            lblMessage.Text = "Registration failed.";
        }
    }