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; } }