コード例 #1
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        //instantiating a fanLoginservice reference object, and the two datacontracts for fan and login
        ServiceReference1.FanLoginServiceClient fs = new ServiceReference1.FanLoginServiceClient();
        ServiceReference1.FanData      fan         = new ServiceReference1.FanData();
        ServiceReference1.FanLoginData login       = new ServiceReference1.FanLoginData();

        fan.fanName  = txtFanName.Text;
        fan.fanEmail = txtEmail.Text;


        login.fanLoginPlainPassword = txtPassword.Text;
        login.fanLoginUserName      = txtUserName.Text;

        //registerFan returns true if user was added to database, otherwise returns false
        Boolean goodRegister = fs.registerFan(fan, login);

        if (goodRegister)
        {
            lblMessage.Text = "Registered Successfully";
        }
        else
        {
            lblMessage.Text = "Error in registration. Try again";
        }
    }
コード例 #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //Instantiate the service client so we have access to the serivce
     ServiceReference1.FanLoginServiceClient sc = new ServiceReference1.FanLoginServiceClient();
     //create an array and assign it the result of the service query
     ServiceReference1.ShowInfo[] shows = sc.GetShowsByVenue(TextBox1.Text);
     //bind the array to the DataGrid
     GridView1.DataSource = shows;
     GridView1.DataBind();
 }