Esempio n. 1
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        //instantiate service
        FanRegistrationLoginService.FanRegistrationLoginServiceClient frc = new FanRegistrationLoginService.FanRegistrationLoginServiceClient();

        //create an instance of Fanlite class from our data Contract
        FanRegistrationLoginService.FanLite fanlite = new FanRegistrationLoginService.FanLite();

        //assign text box content to the reviewerlite properties
        fanlite.FanName  = txtFanName.Text;
        fanlite.FanEmail = txtEmail.Text;

        FanRegistrationLoginService.FanLogin flog = new FanRegistrationLoginService.FanLogin();
        flog.FanLoginUserName      = txtUserName.Text;
        flog.FanLoginPasswordPlain = txtConfirm.Text;
        flog.FanLoginDateAdded     = DateTime.Now;

        //call the register method in the service
        bool result = frc.RegisterFan(fanlite, flog);

        //check the results
        if (result)
        {
            lblResult.Text = "You have succesfully Registered";
        }
        else
        {
            lblResult.Text = "Registration Failed";
        }
    }
Esempio n. 2
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //instantiate the service
        FanRegistrationLoginService.FanRegistrationLoginServiceClient frc = new FanRegistrationLoginService.FanRegistrationLoginServiceClient();
        //call the method
        int id = frc.FanLogin(txtUserName.Text, txtPassword.Text);

        //check the results
        if (id != 0)
        {
            Session["fankey"] = id;
            Response.Redirect("FanPage.aspx");
        }
        else
        {
            lblError.Text = "Invalid Login";
        }
    }