/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcepaupdateresults(ref DataRow row, Icepaupdateresults entity) { row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("prodnotes", entity.prodnotes); row.SetField("proddesc", entity.proddesc); row.SetField("qtycnt", entity.qtycnt); row.SetField("unit", entity.unit); row.SetField("icetnotes", entity.icetnotes); row.SetField("refer", entity.refer); row.SetField("brandcode", entity.brandcode); row.SetField("mfgprod", entity.mfgprod); row.SetField("vendprod", entity.vendprod); row.SetField("notesid", entity.notesid); row.SetField("ICETRowID", entity.iCETRowID.ToByteArray()); row.SetField("cICETRowId", entity.cICETRowId); row.SetField("userfield", entity.userfield); }
public static Icepaupdateresults BuildIcepaupdateresultsFromRow(DataRow row) { Icepaupdateresults entity = new Icepaupdateresults(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodnotes = row.IsNull("prodnotes") ? string.Empty : row.Field <string>("prodnotes"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.qtycnt = row.IsNull("qtycnt") ? decimal.Zero : row.Field <decimal>("qtycnt"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.icetnotes = row.IsNull("icetnotes") ? string.Empty : row.Field <string>("icetnotes"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.brandcode = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode"); entity.mfgprod = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod"); entity.vendprod = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod"); entity.notesid = row.IsNull("notesid") ? 0 : row.Field <int>("notesid"); entity.iCETRowID = row.Field <byte[]>("ICETRowID").ToStringEncoded(); entity.cICETRowId = row.IsNull("cICETRowId") ? string.Empty : row.Field <string>("cICETRowId"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }