/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromGlembresults(ref DataRow row, Glembresults entity) { row.SetField("fieldchanged", entity.fieldchanged); row.SetField("oldvalue", entity.oldvalue); row.SetField("newvalue", entity.newvalue); row.SetField("operinit", entity.operinit); row.SetField("enterdt", entity.enterdt); row.SetField("entertm", entity.entertm); row.SetField("rowid-pv_samb", entity.rowidPvSamb.ToByteArray()); row.SetField("reason", entity.reason); row.SetField("userfield", entity.userfield); }
public static Glembresults BuildGlembresultsFromRow(DataRow row) { Glembresults entity = new Glembresults(); entity.fieldchanged = row.IsNull("fieldchanged") ? string.Empty : row.Field <string>("fieldchanged"); entity.oldvalue = row.IsNull("oldvalue") ? string.Empty : row.Field <string>("oldvalue"); entity.newvalue = row.IsNull("newvalue") ? string.Empty : row.Field <string>("newvalue"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.enterdt = row.Field <DateTime?>("enterdt"); entity.entertm = row.IsNull("entertm") ? string.Empty : row.Field <string>("entertm"); entity.rowidPvSamb = row.Field <byte[]>("rowid-pv_samb").ToStringEncoded(); entity.reason = row.IsNull("reason") ? string.Empty : row.Field <string>("reason"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }