/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdpricesheetlistresults(ref DataRow row, Pdpricesheetlistresults entity) { row.SetField("prod", entity.prod); row.SetField("prodnotesfl", entity.prodnotesfl); row.SetField("whse", entity.whse); row.SetField("pricesheet", entity.pricesheet); row.SetField("effectivedt", entity.effectivedt); row.SetField("baseprice", entity.baseprice); row.SetField("listprice", entity.listprice); row.SetField("replcost", entity.replcost); row.SetField("rebatecost", entity.rebatecost); row.SetField("stndcost", entity.stndcost); row.SetField("slchgdt", entity.slchgdt); row.SetField("brandcode", entity.brandcode); row.SetField("mfgprod", entity.mfgprod); row.SetField("vendprod", entity.vendprod); row.SetField("pv_pdspsRowID", entity.pvPdspsRowID.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Pdpricesheetlistresults BuildPdpricesheetlistresultsFromRow(DataRow row) { Pdpricesheetlistresults entity = new Pdpricesheetlistresults(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodnotesfl = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.pricesheet = row.IsNull("pricesheet") ? string.Empty : row.Field <string>("pricesheet"); entity.effectivedt = row.Field <DateTime?>("effectivedt"); entity.baseprice = row.IsNull("baseprice") ? decimal.Zero : row.Field <decimal>("baseprice"); entity.listprice = row.IsNull("listprice") ? decimal.Zero : row.Field <decimal>("listprice"); entity.replcost = row.IsNull("replcost") ? decimal.Zero : row.Field <decimal>("replcost"); entity.rebatecost = row.IsNull("rebatecost") ? decimal.Zero : row.Field <decimal>("rebatecost"); entity.stndcost = row.IsNull("stndcost") ? decimal.Zero : row.Field <decimal>("stndcost"); entity.slchgdt = row.Field <DateTime?>("slchgdt"); 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.pvPdspsRowID = row.Field <byte[]>("pv_pdspsRowID").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }