protected void btnConfirmReservation_Click(object sender, EventArgs e)
    {
        string s, schoolName, gender, level, address, birth, grade;

        s          = txtStudentName.Text.Trim();
        schoolName = txtSchoolName.Text.Trim();
        gender     = checkGender.SelectedValue;
        address    = txtAddress.Text.Trim();
        birth      = txtDateOfBirth.Text.Trim();
        grade      = dropGrades.Text;
        level      = dropSchoolLevels.SelectedValue;
        bool isSelected = isGenderChecked();

        if (s == "" || schoolName == "" || !isSelected || address == "" || birth == "" || grade == "" || dropSchoolLevels.SelectedIndex == 0)
        {
            lblMsg.Text = "Some Fields Are Required";
        }
        else
        {
            //DateTime d = new DateTime();
            //bool isDate = DateTime.TryParse(txtDateOfBirth.Text.Trim(), out d);
            //if (!isDate){
            //    lblMsg.Text = "Invalid Date";
            //}
            //else{
            ServiceReference1.WebService1SoapClient client = new ServiceReference1.WebService1SoapClient();
            object o = client.MakeReservation(schoolName, s, gender, address, level, birth, grade);
            //Student s = new Student();
            //Student.SchoolName = schoolName;
            //Student.StudentName = studentName;
            //Student.Gender = gender;
            //Student.Address = address;
            //Student.Level = level;
            //Student.Birthdate = birth;
            //Student.Grade = dropGrades.SelectedItem.Text;
            //object obj = s.Reserve();
            if (o != null)
            {
                lblMsg.Text = "You are now booked this school, this is a primitive reservation you must have to go to school to complete the registration process "
                              + "<br />Note: You must print this message(page) before going to the school";
            }
            // }
        }
    }
コード例 #2
0
ファイル: Reference.cs プロジェクト: h9tyf/WebApplication
 public WebService1SoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(WebService1SoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
コード例 #3
0
ファイル: Reference.cs プロジェクト: h9tyf/WebApplication
 public WebService1SoapClient(EndpointConfiguration endpointConfiguration) :
     base(WebService1SoapClient.GetBindingForEndpoint(endpointConfiguration), WebService1SoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }