/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsegkeyfields(ref DataRow row, Icsegkeyfields entity) { row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("accttype", entity.accttype); row.SetField("prodcat", entity.prodcat); row.SetField("whse", entity.whse); row.SetField("custtype", entity.custtype); row.SetField("salesrep", entity.salesrep); row.SetField("cogsadj", entity.cogsadj); row.SetField("userfield", entity.userfield); }
public static Icsegkeyfields BuildIcsegkeyfieldsFromRow(DataRow row) { Icsegkeyfields entity = new Icsegkeyfields(); entity.rowid = row.Field <byte[]>("rowid").ToStringEncoded(); entity.accttype = row.Field <bool>("accttype"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.custtype = row.IsNull("custtype") ? string.Empty : row.Field <string>("custtype"); entity.salesrep = row.IsNull("salesrep") ? string.Empty : row.Field <string>("salesrep"); entity.cogsadj = row.IsNull("cogsadj") ? string.Empty : row.Field <string>("cogsadj"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }