/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSasulookup(ref DataRow row, Sasulookup entity) { row.SetField("primarykey", entity.primarykey); row.SetField("secondarykey", entity.secondarykey); row.SetField("pageno", entity.pageno); row.SetField("rowID", entity.rowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Sasulookup BuildSasulookupFromRow(DataRow row) { Sasulookup entity = new Sasulookup(); entity.primarykey = row.IsNull("primarykey") ? string.Empty : row.Field <string>("primarykey"); entity.secondarykey = row.IsNull("secondarykey") ? string.Empty : row.Field <string>("secondarykey"); entity.pageno = row.IsNull("pageno") ? 0 : row.Field <int>("pageno"); entity.rowID = row.Field <byte[]>("rowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }