private int ValidateDataTable(DataTable dtData)
{
int result = 0; //-10 when data table is empty
// 0 when any series not selected
// 1 when validated successfull
if (dtData != null && dtData.Rows.Count > 0)
{
foreach (DataRow drData in dtData.Rows)
{
bool select;
bool.TryParse(Convert.ToString(drData["Select"]), out select);
if (select.Equals(true))
{
result = 1;
break;
}
else
{
result = 0;
}
}
}
else
{
result = -1;
}
return result;
}
{
int result = 0; //-10 when data table is empty
// 0 when any series not selected
// 1 when validated successfull
if (dtData != null && dtData.Rows.Count > 0)
{
foreach (DataRow drData in dtData.Rows)
{
bool select;
bool.TryParse(Convert.ToString(drData["Select"]), out select);
if (select.Equals(true))
{
result = 1;
break;
}
else
{
result = 0;
}
}
}
else
{
result = -1;
}
return result;
}
No comments:
Post a Comment