/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIonioboxresults(ref DataRow row, Ionioboxresults entity) { row.SetField("id", entity.id); row.SetField("accountingentity", entity.accountingentity); row.SetField("bodtype", entity.bodtype); row.SetField("createdatetime", entity.createdatetime); row.SetField("fromlogicalid", entity.fromlogicalid); row.SetField("tologicalid", entity.tologicalid); row.SetField("messageid", entity.messageid); row.SetField("wasprocessed", entity.wasprocessed); row.SetField("wasprocesseddisplay", entity.wasprocesseddisplay); row.SetField("bodid", entity.bodid); row.SetField("dbrowid", entity.dbrowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Ionioboxresults BuildIonioboxresultsFromRow(DataRow row) { Ionioboxresults entity = new Ionioboxresults(); entity.id = row.IsNull("id") ? 0 : row.Field <long>("id"); entity.accountingentity = row.IsNull("accountingentity") ? string.Empty : row.Field <string>("accountingentity"); entity.bodtype = row.IsNull("bodtype") ? string.Empty : row.Field <string>("bodtype"); entity.createdatetime = row.Field <DateTime?>("createdatetime"); entity.fromlogicalid = row.IsNull("fromlogicalid") ? string.Empty : row.Field <string>("fromlogicalid"); entity.tologicalid = row.IsNull("tologicalid") ? string.Empty : row.Field <string>("tologicalid"); entity.messageid = row.IsNull("messageid") ? string.Empty : row.Field <string>("messageid"); entity.wasprocessed = row.IsNull("wasprocessed") ? 0 : row.Field <int>("wasprocessed"); entity.wasprocesseddisplay = row.IsNull("wasprocesseddisplay") ? string.Empty : row.Field <string>("wasprocesseddisplay"); entity.bodid = row.IsNull("bodid") ? string.Empty : row.Field <string>("bodid"); entity.dbrowid = row.Field <byte[]>("dbrowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }