attribute.Key.ToString() -- is the CRM attribute name
row[attribute.Value] -- The External SQL table value
For money
if (attribute.Key.ToString() == "derivedproposaltotal" )
{
decimal mymoney = Convert.ToDecimal(row[attribute.Value].ToString());
entity[attribute.Key.ToString()] = new Money(mymoney);
}
For Time
if (attribute.Key.ToString() == "derivedawarddate" )
{
string mySourceString, myDateString;
mySourceString = row[attribute.Value].ToString();
myDateString = string.Concat(mySourceString.Substring(0, 10), "T", mySourceString.Substring(11, 8));
entity[attribute.Key.ToString()] = DateTime.Parse(myDateString);
}
No comments:
Post a Comment