Thought I'd post the c# code Lesson 23 -
I saw some earlier questions about c# code for the scripts and the IsDate() isnt as handy in c# as it is in
VB.
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
if (IsDate(Row.DateFirstPurchase) == false)
{
Row.DateFirstPurchase = DateTime.Now.ToString();
}
if (IsDate(Row.BirthDate) == true)
{
Row.DirectRowToValidateddata();
}
else
{
Row.DirectRowToBadData();
}
}
public bool IsDate(string sdate)
{
DateTime dt;
bool isDate = true;
try
{
dt = DateTime.Parse(sdate);
}
catch
{
isDate = false;
}
return isDate;
}