예제 #1
0
 /// <remarks/>
 public void AgesAsync(DOB dbo, object userState) {
     if ((this.AgesOperationCompleted == null)) {
         this.AgesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAgesOperationCompleted);
     }
     this.InvokeAsync("Ages", new object[] {
                 dbo}, this.AgesOperationCompleted, userState);
 }
예제 #2
0
 public void Ages([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] DOB dbo, out int AgesResult, [System.Xml.Serialization.XmlIgnoreAttribute()] out bool AgesResultSpecified, out int days, [System.Xml.Serialization.XmlIgnoreAttribute()] out bool daysSpecified, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] out string yourAge) {
     object[] results = this.Invoke("Ages", new object[] {
                 dbo});
     AgesResult = ((int)(results[0]));
     AgesResultSpecified = ((bool)(results[1]));
     days = ((int)(results[2]));
     daysSpecified = ((bool)(results[3]));
     yourAge = ((string)(results[4]));
 }
        protected void Button11_Click(object sender, EventArgs e)
        {
            int      year  = System.Convert.ToInt32(SelectYears.SelectedValue);
            int      month = System.Convert.ToInt32(SelectMonth.SelectedValue);
            int      day   = System.Convert.ToInt32(SelectDay.SelectedValue);
            DateTime dt    = new DateTime(year, month, day);

            switch (myFunction)
            {
            case Age:     //DOB not working value won't passed to service
                AgeCalculation.DOB      d  = new AgeCalculation.DOB();
                AgeCalculation.Service1 ws = new AgeCalculation.Service1();
                d.Day   = dt.Day;
                d.Month = dt.Month;
                d.Year  = dt.Year;

                //ws.Ages(d, out int agesResult, out bool AgesresualtSpecified, out int days, out bool daysSpecified, out string yourAge);
                ws.Ages(d, out int AgesResult, out bool AgesResultSpecified, out int days, out bool daysSpecified, out string yourAge);
                this.Label1.Text      = "Your ages: ";
                this.TextBox1.Text    = yourAge;
                this.Label1.Visible   = true;
                this.TextBox1.Visible = true;
                this.SelectDay.Items.Clear();
                this.SelectMonth.Items.Clear();
                this.SelectYears.Items.Clear();
                break;

            case AgeYMD:

                AgeCalculation.Service1 wsYMD = new AgeCalculation.Service1();


                wsYMD.AgesYMD(year, true, month, true, day, true, out int AgesYMDResult, out bool agesYMDResultSpecified, out int Outdays, out bool dayspecified, out string OutyourAge);

                this.Label1.Text      = "Your ages: ";
                this.TextBox1.Text    = OutyourAge;
                this.Label1.Visible   = true;
                this.TextBox1.Visible = true;

                break;
            }
            this.SelectYears.Visible = false;
            this.SelectDay.Visible   = false;
            this.SelectMonth.Visible = false;
            this.Button11.Visible    = false;
        }
        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            switch (myFunction)
            {
            case Age:     //DOB not working value won't passed to service
                AgeCalculation.DOB      d  = new AgeCalculation.DOB();
                AgeCalculation.Service1 ws = new AgeCalculation.Service1();
                d.Day   = this.Calendar1.SelectedDate.Day;
                d.Month = this.Calendar1.SelectedDate.Month;
                d.Year  = this.Calendar1.SelectedDate.Year;
                //ws.Ages(d, out int agesResult, out bool AgesresualtSpecified, out int days, out bool daysSpecified, out string yourAge);
                int    agesResult;
                bool   AgesresualtSpecified;
                int    days;
                bool   daysSpecified;
                string yourAge;
                ws.Ages(d, out agesResult, out AgesresualtSpecified, out days, out daysSpecified, out yourAge);

                this.Label1.Text      = "Your ages: ";
                this.TextBox1.Text    = yourAge;
                this.Label1.Visible   = true;
                this.TextBox1.Visible = true;

                break;

            case AgeYMD:

                AgeCalculation.Service1 wsYMD = new AgeCalculation.Service1();
                int day   = this.Calendar1.SelectedDate.Day;
                int month = this.Calendar1.SelectedDate.Month;
                int year  = this.Calendar1.SelectedDate.Year;


                wsYMD.AgesYMD(year, true, month, true, day, true, out int AgesYMDResult, out bool agesYMDResultSpecified, out int Outdays, out bool dayspecified, out string OutyourAge);

                this.Label1.Text      = "Your ages: ";
                this.TextBox1.Text    = OutyourAge;
                this.Label1.Visible   = true;
                this.TextBox1.Visible = true;

                break;
            }
        }
예제 #5
0
 /// <remarks/>
 public void AgesAsync(DOB dbo) {
     this.AgesAsync(dbo, null);
 }