/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdspnpresults(ref DataRow row, Pdspnpresults entity) { row.SetField("levelcd", entity.levelcd); row.SetField("clevelcd", entity.clevelcd); row.SetField("pdrecno", entity.pdrecno); row.SetField("vendno", entity.vendno); row.SetField("vendnotesfl", entity.vendnotesfl); row.SetField("custno", entity.custno); row.SetField("custnotesfl", entity.custnotesfl); row.SetField("custtype", entity.custtype); row.SetField("shiptonotesfl", entity.shiptonotesfl); row.SetField("custgroup", entity.custgroup); row.SetField("custpricety", entity.custpricety); row.SetField("prod", entity.prod); row.SetField("prodnotesfl", entity.prodnotesfl); row.SetField("modelcode", entity.modelcode); row.SetField("brandcode", entity.brandcode); row.SetField("prodcat", entity.prodcat); row.SetField("prodline", entity.prodline); row.SetField("prodprcty", entity.prodprcty); row.SetField("rebatety", entity.rebatety); row.SetField("rebsubty", entity.rebsubty); row.SetField("startdt", entity.startdt); row.SetField("typecode", entity.typecode); row.SetField("whse", entity.whse); row.SetField("statustype", entity.statustype); row.SetField("enddt", entity.enddt); row.SetField("promofl", entity.promofl); row.SetField("pd_rowid", entity.pdRowid.ToByteArray()); row.SetField("mfgprod", entity.mfgprod); row.SetField("vendprod", entity.vendprod); row.SetField("lastuseddt", entity.lastuseddt); row.SetField("userfield", entity.userfield); }
public static Pdspnpresults BuildPdspnpresultsFromRow(DataRow row) { Pdspnpresults entity = new Pdspnpresults(); entity.levelcd = row.IsNull("levelcd") ? string.Empty : row.Field <string>("levelcd"); entity.clevelcd = row.IsNull("clevelcd") ? string.Empty : row.Field <string>("clevelcd"); entity.pdrecno = row.IsNull("pdrecno") ? 0 : row.Field <int>("pdrecno"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendnotesfl = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.custnotesfl = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl"); entity.custtype = row.IsNull("custtype") ? string.Empty : row.Field <string>("custtype"); entity.shiptonotesfl = row.IsNull("shiptonotesfl") ? string.Empty : row.Field <string>("shiptonotesfl"); entity.custgroup = row.IsNull("custgroup") ? string.Empty : row.Field <string>("custgroup"); entity.custpricety = row.IsNull("custpricety") ? string.Empty : row.Field <string>("custpricety"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodnotesfl = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl"); entity.modelcode = row.IsNull("modelcode") ? string.Empty : row.Field <string>("modelcode"); entity.brandcode = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.prodprcty = row.IsNull("prodprcty") ? string.Empty : row.Field <string>("prodprcty"); entity.rebatety = row.IsNull("rebatety") ? string.Empty : row.Field <string>("rebatety"); entity.rebsubty = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty"); entity.startdt = row.Field <DateTime?>("startdt"); entity.typecode = row.IsNull("typecode") ? string.Empty : row.Field <string>("typecode"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.enddt = row.Field <DateTime?>("enddt"); entity.promofl = row.Field <bool>("promofl"); entity.pdRowid = row.Field <byte[]>("pd_rowid").ToStringEncoded(); entity.mfgprod = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod"); entity.vendprod = row.IsNull("vendprod") ? string.Empty : row.Field <string>("vendprod"); entity.lastuseddt = row.Field <DateTime?>("lastuseddt"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }