string strDOB = ""; string strDebtType = "";
txtJudgementdate.Text = hdnJudgementdate.Value;
txtCostCertificationDate.Text = hdnCostCertificationDate.Value;
txtDefaultDate.Text = hdnDefaultDate.Value;
if (ddlDay.SelectedIndex > 0)
if (ddlMonth.SelectedIndex > 0 && ddlYear.SelectedIndex > 0)
{
if (ddlMonth.SelectedIndex == 4 || ddlMonth.SelectedIndex == 6 || ddlMonth.SelectedIndex == 9 || ddlMonth.SelectedIndex == 11)
{
if (ddlDay.SelectedIndex > 30)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
else if (ddlMonth.SelectedIndex == 2)
{
if (Convert.ToInt32(ddlYear.SelectedValue) % 4 == 0)
{
if (ddlDay.SelectedIndex > 29)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
else
{
if (ddlDay.SelectedIndex > 28)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
}
strDOB = new DateTime(Convert.ToInt32(ddlYear.SelectedValue), Convert.ToInt16(ddlMonth.SelectedIndex), Convert.ToInt16(ddlDay.SelectedValue)).ToString("dd/MM/yyyy");
//strDOB = DateTime.Parse(ddlDay.SelectedValue + "/" + Convert.ToInt16(ddlMonth.SelectedIndex) + "/" + Convert.ToInt32(ddlYear.SelectedValue)).ToString("dd/MM/yyyy");
}
else
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
else if (ddlMonth.SelectedIndex > 0)
if (ddlDay.SelectedIndex > 0 && ddlYear.SelectedIndex > 0)
{
if (ddlMonth.SelectedIndex == 4 || ddlMonth.SelectedIndex == 6 || ddlMonth.SelectedIndex == 9 || ddlMonth.SelectedIndex == 11)
{
if (ddlDay.SelectedIndex > 30)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}}
else if (ddlMonth.SelectedIndex == 2)
{
if (Convert.ToInt32(ddlYear.SelectedValue) % 4 == 0)
{
if (ddlDay.SelectedIndex > 29)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
else
{
if (ddlDay.SelectedIndex > 28)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
}
strDOB = new DateTime(Convert.ToInt32(ddlYear.SelectedValue), Convert.ToInt16(ddlMonth.SelectedIndex), Convert.ToInt16(ddlDay.SelectedValue)).ToString("dd/MM/yyyy");
}
else
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
else if (ddlYear.SelectedIndex > 0)
if (ddlMonth.SelectedIndex > 0 && ddlDay.SelectedIndex > 0)
{
if (ddlMonth.SelectedIndex == 4 || ddlMonth.SelectedIndex == 6 || ddlMonth.SelectedIndex == 9 || ddlMonth.SelectedIndex == 11)
{
if (ddlDay.SelectedIndex > 30)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}}
else if (ddlMonth.SelectedIndex == 2)
{
if (Convert.ToInt32(ddlYear.SelectedValue) % 4 == 0)
{
if (ddlDay.SelectedIndex > 29)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
else
{
if (ddlDay.SelectedIndex > 28)
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}
}
}
strDOB = new DateTime(Convert.ToInt32(ddlYear.SelectedValue), Convert.ToInt16(ddlMonth.SelectedIndex), Convert.ToInt16(ddlDay.SelectedValue)).ToString("dd/MM/yyyy");
}
else
{
lblError.Text = "Please Select Valid Date of Birth.";
return;
}