/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSleeproductfull(ref DataRow row, Sleeproductfull entity) { row.SetField("sledrowid", entity.sledrowid.ToByteArray()); row.SetField("imptype", entity.imptype); row.SetField("slupdtno", entity.slupdtno); row.SetField("statuscd", entity.statuscd); row.SetField("statuscdenabled", entity.statuscdenabled); row.SetField("slpbseqno", entity.slpbseqno); row.SetField("whse", entity.whse); row.SetField("whseenabled", entity.whseenabled); row.SetField("prod", entity.prod); row.SetField("prodenabled", entity.prodenabled); row.SetField("pdspsfl", entity.pdspsfl); row.SetField("pdspsflenabled", entity.pdspsflenabled); row.SetField("descrip1", entity.descrip1); row.SetField("descrip1enabled", entity.descrip1enabled); row.SetField("descrip2", entity.descrip2); row.SetField("descrip3", entity.descrip3); row.SetField("lookupnm", entity.lookupnm); row.SetField("lookupnmenabled", entity.lookupnmenabled); row.SetField("seqno", entity.seqno); row.SetField("seqnoenabled", entity.seqnoenabled); row.SetField("pdscfl", entity.pdscfl); row.SetField("pdscflenabled", entity.pdscflenabled); row.SetField("pdsvfl", entity.pdsvfl); row.SetField("pdsvflenabled", entity.pdsvflenabled); row.SetField("costtext", entity.costtext); row.SetField("currtext", entity.currtext); row.SetField("icscfl", entity.icscfl); row.SetField("icscflenabled", entity.icscflenabled); row.SetField("baseprice", entity.baseprice); row.SetField("basepriceenabled", entity.basepriceenabled); row.SetField("basepricehidden", entity.basepricehidden); row.SetField("currbaseprice", entity.currbaseprice); row.SetField("icspfl", entity.icspfl); row.SetField("icspflenabled", entity.icspflenabled); row.SetField("listprice", entity.listprice); row.SetField("listpriceenabled", entity.listpriceenabled); row.SetField("listpricehidden", entity.listpricehidden); row.SetField("currlistprice", entity.currlistprice); row.SetField("icswfl", entity.icswfl); row.SetField("icswflenabled", entity.icswflenabled); row.SetField("replcost", entity.replcost); row.SetField("replcostenabled", entity.replcostenabled); row.SetField("replcosthidden", entity.replcosthidden); row.SetField("currreplcost", entity.currreplcost); row.SetField("priceonty", entity.priceonty); row.SetField("priceontyenabled", entity.priceontyenabled); row.SetField("stndcost", entity.stndcost); row.SetField("stndcostenabled", entity.stndcostenabled); row.SetField("stndcosthidden", entity.stndcosthidden); row.SetField("currstndcost", entity.currstndcost); row.SetField("effectdt", entity.effectdt); row.SetField("effectdtenabled", entity.effectdtenabled); row.SetField("lastcostfor", entity.lastcostfor); row.SetField("lastcostforenabled", entity.lastcostforenabled); row.SetField("lastcostforhidden", entity.lastcostforhidden); row.SetField("currlastcostfor", entity.currlastcostfor); row.SetField("unitstock", entity.unitstock); row.SetField("unitstockenabled", entity.unitstockenabled); row.SetField("unitstnd", entity.unitstnd); row.SetField("unitstndenabled", entity.unitstndenabled); row.SetField("rebatecost", entity.rebatecost); row.SetField("rebatecostenabled", entity.rebatecostenabled); row.SetField("rebatecosthidden", entity.rebatecosthidden); row.SetField("currrebcost", entity.currrebcost); row.SetField("termspct", entity.termspct); row.SetField("termspctenabled", entity.termspctenabled); row.SetField("vendno", entity.vendno); row.SetField("vendnoenabled", entity.vendnoenabled); row.SetField("weight", entity.weight); row.SetField("weightenabled", entity.weightenabled); row.SetField("prodline", entity.prodline); row.SetField("prodlineenabled", entity.prodlineenabled); row.SetField("cubes", entity.cubes); row.SetField("cubesenabled", entity.cubesenabled); row.SetField("prodcat", entity.prodcat); row.SetField("prodcatenabled", entity.prodcatenabled); row.SetField("slgroup", entity.slgroup); row.SetField("slgroupenabled", entity.slgroupenabled); row.SetField("pricetype", entity.pricetype); row.SetField("pricetypeenabled", entity.pricetypeenabled); row.SetField("rebatety", entity.rebatety); row.SetField("rebatetyenabled", entity.rebatetyenabled); row.SetField("user1", entity.user1); row.SetField("user1enabled", entity.user1enabled); row.SetField("rebsubty", entity.rebsubty); row.SetField("rebsubtyenabled", entity.rebsubtyenabled); row.SetField("user2", entity.user2); row.SetField("userfield", entity.userfield); }
public static Sleeproductfull BuildSleeproductfullFromRow(DataRow row) { Sleeproductfull entity = new Sleeproductfull(); entity.sledrowid = row.Field <byte[]>("sledrowid").ToStringEncoded(); entity.imptype = row.IsNull("imptype") ? string.Empty : row.Field <string>("imptype"); entity.slupdtno = row.IsNull("slupdtno") ? string.Empty : row.Field <string>("slupdtno"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.statuscdenabled = row.Field <bool>("statuscdenabled"); entity.slpbseqno = row.IsNull("slpbseqno") ? 0 : row.Field <int>("slpbseqno"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.whseenabled = row.Field <bool>("whseenabled"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodenabled = row.Field <bool>("prodenabled"); entity.pdspsfl = row.IsNull("pdspsfl") ? string.Empty : row.Field <string>("pdspsfl"); entity.pdspsflenabled = row.Field <bool>("pdspsflenabled"); entity.descrip1 = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1"); entity.descrip1enabled = row.Field <bool>("descrip1enabled"); entity.descrip2 = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2"); entity.descrip3 = row.IsNull("descrip3") ? string.Empty : row.Field <string>("descrip3"); entity.lookupnm = row.IsNull("lookupnm") ? string.Empty : row.Field <string>("lookupnm"); entity.lookupnmenabled = row.Field <bool>("lookupnmenabled"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.seqnoenabled = row.Field <bool>("seqnoenabled"); entity.pdscfl = row.Field <bool>("pdscfl"); entity.pdscflenabled = row.Field <bool>("pdscflenabled"); entity.pdsvfl = row.Field <bool>("pdsvfl"); entity.pdsvflenabled = row.Field <bool>("pdsvflenabled"); entity.costtext = row.IsNull("costtext") ? string.Empty : row.Field <string>("costtext"); entity.currtext = row.IsNull("currtext") ? string.Empty : row.Field <string>("currtext"); entity.icscfl = row.Field <bool>("icscfl"); entity.icscflenabled = row.Field <bool>("icscflenabled"); entity.baseprice = row.IsNull("baseprice") ? decimal.Zero : row.Field <decimal>("baseprice"); entity.basepriceenabled = row.Field <bool>("basepriceenabled"); entity.basepricehidden = row.Field <bool>("basepricehidden"); entity.currbaseprice = row.IsNull("currbaseprice") ? decimal.Zero : row.Field <decimal>("currbaseprice"); entity.icspfl = row.Field <bool>("icspfl"); entity.icspflenabled = row.Field <bool>("icspflenabled"); entity.listprice = row.IsNull("listprice") ? decimal.Zero : row.Field <decimal>("listprice"); entity.listpriceenabled = row.Field <bool>("listpriceenabled"); entity.listpricehidden = row.Field <bool>("listpricehidden"); entity.currlistprice = row.IsNull("currlistprice") ? decimal.Zero : row.Field <decimal>("currlistprice"); entity.icswfl = row.Field <bool>("icswfl"); entity.icswflenabled = row.Field <bool>("icswflenabled"); entity.replcost = row.IsNull("replcost") ? decimal.Zero : row.Field <decimal>("replcost"); entity.replcostenabled = row.Field <bool>("replcostenabled"); entity.replcosthidden = row.Field <bool>("replcosthidden"); entity.currreplcost = row.IsNull("currreplcost") ? decimal.Zero : row.Field <decimal>("currreplcost"); entity.priceonty = row.IsNull("priceonty") ? string.Empty : row.Field <string>("priceonty"); entity.priceontyenabled = row.Field <bool>("priceontyenabled"); entity.stndcost = row.IsNull("stndcost") ? decimal.Zero : row.Field <decimal>("stndcost"); entity.stndcostenabled = row.Field <bool>("stndcostenabled"); entity.stndcosthidden = row.Field <bool>("stndcosthidden"); entity.currstndcost = row.IsNull("currstndcost") ? decimal.Zero : row.Field <decimal>("currstndcost"); entity.effectdt = row.Field <DateTime?>("effectdt"); entity.effectdtenabled = row.Field <bool>("effectdtenabled"); entity.lastcostfor = row.IsNull("lastcostfor") ? decimal.Zero : row.Field <decimal>("lastcostfor"); entity.lastcostforenabled = row.Field <bool>("lastcostforenabled"); entity.lastcostforhidden = row.Field <bool>("lastcostforhidden"); entity.currlastcostfor = row.IsNull("currlastcostfor") ? decimal.Zero : row.Field <decimal>("currlastcostfor"); entity.unitstock = row.IsNull("unitstock") ? string.Empty : row.Field <string>("unitstock"); entity.unitstockenabled = row.Field <bool>("unitstockenabled"); entity.unitstnd = row.IsNull("unitstnd") ? string.Empty : row.Field <string>("unitstnd"); entity.unitstndenabled = row.Field <bool>("unitstndenabled"); entity.rebatecost = row.IsNull("rebatecost") ? decimal.Zero : row.Field <decimal>("rebatecost"); entity.rebatecostenabled = row.Field <bool>("rebatecostenabled"); entity.rebatecosthidden = row.Field <bool>("rebatecosthidden"); entity.currrebcost = row.IsNull("currrebcost") ? decimal.Zero : row.Field <decimal>("currrebcost"); entity.termspct = row.IsNull("termspct") ? decimal.Zero : row.Field <decimal>("termspct"); entity.termspctenabled = row.Field <bool>("termspctenabled"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendnoenabled = row.Field <bool>("vendnoenabled"); entity.weight = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight"); entity.weightenabled = row.Field <bool>("weightenabled"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.prodlineenabled = row.Field <bool>("prodlineenabled"); entity.cubes = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes"); entity.cubesenabled = row.Field <bool>("cubesenabled"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodcatenabled = row.Field <bool>("prodcatenabled"); entity.slgroup = row.IsNull("slgroup") ? string.Empty : row.Field <string>("slgroup"); entity.slgroupenabled = row.Field <bool>("slgroupenabled"); entity.pricetype = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype"); entity.pricetypeenabled = row.Field <bool>("pricetypeenabled"); entity.rebatety = row.IsNull("rebatety") ? string.Empty : row.Field <string>("rebatety"); entity.rebatetyenabled = row.Field <bool>("rebatetyenabled"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user1enabled = row.Field <bool>("user1enabled"); entity.rebsubty = row.IsNull("rebsubty") ? string.Empty : row.Field <string>("rebsubty"); entity.rebsubtyenabled = row.Field <bool>("rebsubtyenabled"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }