예제 #1
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //instantiate the service
        VenueRegistrationLoginService.VenueRegistrationServiceClient rc = new VenueRegistrationLoginService.VenueRegistrationServiceClient();
        //call the method
        int id = rc.VenueLogin(txtUserName.Text, txtPassword.Text);

        //check the results
        if (id != 0)
        {
            Session["venuekey"] = id;
            Response.Redirect("AddShow.aspx");
        }
        else
        {
            lblError.Text = "Invalid Login";
        }
    }
예제 #2
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        //instantiate service
        VenueRegistrationLoginService.VenueRegistrationServiceClient rc = new VenueRegistrationLoginService.VenueRegistrationServiceClient();

        //create an instance of venuelite class from our data Contract
        VenueRegistrationLoginService.VenueLite venlite = new VenueRegistrationLoginService.VenueLite();

        //assign text box content to the reviewerlite properties
        venlite.venueName           = txtVenueName.Text;
        venlite.Email               = txtEmail.Text;
        venlite.VenueAddress        = txtAddress.Text;
        venlite.VenueCity           = txtCity.Text;
        venlite.VenueState          = txtState.Text;
        venlite.VenueZip            = txtZip.Text;
        venlite.VenuePhone          = txtPhone.Text;
        venlite.VenueWebsite        = txtWebsite.Text;
        venlite.VenueAgeRestriction = int.Parse(txtAge.Text);

        VenueRegistrationLoginService.VenueLogin vlog = new VenueRegistrationLoginService.VenueLogin();
        vlog.VenueLoginUserName      = txtUserName.Text;
        vlog.VenueLoginPasswordPlain = txtConfirm.Text;
        vlog.VenueLoginDateAdded     = DateTime.Now;

        //call the register method in the service
        bool result = rc.RegisterVenue(venlite, vlog);

        //check the results
        if (result)
        {
            lblResult.Text = "You have succesfully Registered";
        }
        else
        {
            lblResult.Text = "Registration Failed";
        }
    }