/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromApsplookupresults(ref DataRow row, Apsplookupresults entity) { row.SetField("vendno", entity.vendno); row.SetField("notesfl", entity.notesfl); row.SetField("vendname", entity.vendname); row.SetField("whse", entity.whse); row.SetField("prodline", entity.prodline); row.SetField("yr", entity.yr); row.SetField("rowid-apsp", entity.rowidApsp.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Apsplookupresults BuildApsplookupresultsFromRow(DataRow row) { Apsplookupresults entity = new Apsplookupresults(); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.vendname = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.yr = row.IsNull("yr") ? 0 : row.Field <int>("yr"); entity.rowidApsp = row.Field <byte[]>("rowid-apsp").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }