/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPoitccomponent(ref DataRow row, Poitccomponent entity) { row.SetField("qtyord", entity.qtyord); row.SetField("length", entity.length); row.SetField("extend", entity.extend); row.SetField("shipprod", entity.shipprod); row.SetField("notesfl", entity.notesfl); row.SetField("descrip1", entity.descrip1); row.SetField("descrip2", entity.descrip2); row.SetField("qtyavail", entity.qtyavail); row.SetField("adjcost", entity.adjcost); row.SetField("prodcost", entity.prodcost); row.SetField("invcost", entity.invcost); row.SetField("qtyonhand", entity.qtyonhand); row.SetField("qtyonorder", entity.qtyonorder); row.SetField("compseqno", entity.compseqno); row.SetField("icspecrecno", entity.icspecrecno); row.SetField("origprod", entity.origprod); row.SetField("qtybf", entity.qtybf); row.SetField("qtyloose", entity.qtyloose); row.SetField("statustype", entity.statustype); row.SetField("whse", entity.whse); row.SetField("ttoeelmrowid", entity.ttoeelmrowid.ToByteArray()); row.SetField("lengthenabled", entity.lengthenabled); row.SetField("shipprodhidden", entity.shipprodhidden); row.SetField("qtyavailhidden", entity.qtyavailhidden); row.SetField("addonamt1", entity.addonamt1); row.SetField("addonamt2", entity.addonamt2); row.SetField("addonamt3", entity.addonamt3); row.SetField("addonamt4", entity.addonamt4); row.SetField("adjfactor", entity.adjfactor); row.SetField("bundleid", entity.bundleid); row.SetField("commcost", entity.commcost); row.SetField("compaddonamt", entity.compaddonamt); row.SetField("compdiscount", entity.compdiscount); row.SetField("cono", entity.cono); row.SetField("conv", entity.conv); row.SetField("custno", entity.custno); row.SetField("delayresrvfl", entity.delayresrvfl); row.SetField("dlength", entity.dlength); row.SetField("glcost", entity.glcost); row.SetField("glcostrcv", entity.glcostrcv); row.SetField("lineno", entity.lineno); row.SetField("netamt", entity.netamt); row.SetField("netcostamt", entity.netcostamt); row.SetField("netcostedamt", entity.netcostedamt); row.SetField("netcostord", entity.netcostord); row.SetField("netord", entity.netord); row.SetField("oemixpct", entity.oemixpct); row.SetField("operinit", entity.operinit); row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("ordertype", entity.ordertype); row.SetField("pdrecno", entity.pdrecno); row.SetField("pomixpct", entity.pomixpct); row.SetField("prevconv", entity.prevconv); row.SetField("prevprod", entity.prevprod); row.SetField("prevqtyord", entity.prevqtyord); row.SetField("prevqtyship", entity.prevqtyship); row.SetField("prevqtyshp", entity.prevqtyshp); row.SetField("prevunit", entity.prevunit); row.SetField("price", entity.price); row.SetField("pricefl", entity.pricefl); row.SetField("qtybundle", entity.qtybundle); row.SetField("qtycosted", entity.qtycosted); row.SetField("qtyprevbundle", entity.qtyprevbundle); row.SetField("qtyship", entity.qtyship); row.SetField("reqprod", entity.reqprod); row.SetField("seqno", entity.seqno); row.SetField("shipto", entity.shipto); row.SetField("shpqtyoverfl", entity.shpqtyoverfl); row.SetField("stkqtycosted", entity.stkqtycosted); row.SetField("stkqtyord", entity.stkqtyord); row.SetField("stkqtyship", entity.stkqtyship); row.SetField("transdt", entity.transdt); row.SetField("transproc", entity.transproc); row.SetField("transtm", entity.transtm); row.SetField("transtype", entity.transtype); row.SetField("unit", entity.unit); row.SetField("userfield", entity.userfield); }
public static Poitccomponent BuildPoitccomponentFromRow(DataRow row) { Poitccomponent entity = new Poitccomponent(); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.length = row.IsNull("length") ? 0 : row.Field <int>("length"); entity.extend = row.IsNull("extend") ? decimal.Zero : row.Field <decimal>("extend"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.descrip1 = row.IsNull("descrip1") ? string.Empty : row.Field <string>("descrip1"); entity.descrip2 = row.IsNull("descrip2") ? string.Empty : row.Field <string>("descrip2"); entity.qtyavail = row.IsNull("qtyavail") ? decimal.Zero : row.Field <decimal>("qtyavail"); entity.adjcost = row.IsNull("adjcost") ? decimal.Zero : row.Field <decimal>("adjcost"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.invcost = row.IsNull("invcost") ? decimal.Zero : row.Field <decimal>("invcost"); entity.qtyonhand = row.IsNull("qtyonhand") ? decimal.Zero : row.Field <decimal>("qtyonhand"); entity.qtyonorder = row.IsNull("qtyonorder") ? decimal.Zero : row.Field <decimal>("qtyonorder"); entity.compseqno = row.IsNull("compseqno") ? 0 : row.Field <int>("compseqno"); entity.icspecrecno = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno"); entity.origprod = row.IsNull("origprod") ? string.Empty : row.Field <string>("origprod"); entity.qtybf = row.IsNull("qtybf") ? decimal.Zero : row.Field <decimal>("qtybf"); entity.qtyloose = row.IsNull("qtyloose") ? decimal.Zero : row.Field <decimal>("qtyloose"); entity.statustype = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.ttoeelmrowid = row.Field <byte[]>("ttoeelmrowid").ToStringEncoded(); entity.lengthenabled = row.Field <bool>("lengthenabled"); entity.shipprodhidden = row.Field <bool>("shipprodhidden"); entity.qtyavailhidden = row.Field <bool>("qtyavailhidden"); entity.addonamt1 = row.IsNull("addonamt1") ? decimal.Zero : row.Field <decimal>("addonamt1"); entity.addonamt2 = row.IsNull("addonamt2") ? decimal.Zero : row.Field <decimal>("addonamt2"); entity.addonamt3 = row.IsNull("addonamt3") ? decimal.Zero : row.Field <decimal>("addonamt3"); entity.addonamt4 = row.IsNull("addonamt4") ? decimal.Zero : row.Field <decimal>("addonamt4"); entity.adjfactor = row.IsNull("adjfactor") ? decimal.Zero : row.Field <decimal>("adjfactor"); entity.bundleid = row.IsNull("bundleid") ? string.Empty : row.Field <string>("bundleid"); entity.commcost = row.IsNull("commcost") ? decimal.Zero : row.Field <decimal>("commcost"); entity.compaddonamt = row.IsNull("compaddonamt") ? decimal.Zero : row.Field <decimal>("compaddonamt"); entity.compdiscount = row.IsNull("compdiscount") ? decimal.Zero : row.Field <decimal>("compdiscount"); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.conv = row.IsNull("conv") ? decimal.Zero : row.Field <decimal>("conv"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.delayresrvfl = row.Field <bool>("delayresrvfl"); entity.dlength = row.IsNull("dlength") ? decimal.Zero : row.Field <decimal>("dlength"); entity.glcost = row.IsNull("glcost") ? decimal.Zero : row.Field <decimal>("glcost"); entity.glcostrcv = row.IsNull("glcostrcv") ? decimal.Zero : row.Field <decimal>("glcostrcv"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.netamt = row.IsNull("netamt") ? decimal.Zero : row.Field <decimal>("netamt"); entity.netcostamt = row.IsNull("netcostamt") ? decimal.Zero : row.Field <decimal>("netcostamt"); entity.netcostedamt = row.IsNull("netcostedamt") ? decimal.Zero : row.Field <decimal>("netcostedamt"); entity.netcostord = row.IsNull("netcostord") ? decimal.Zero : row.Field <decimal>("netcostord"); entity.netord = row.IsNull("netord") ? decimal.Zero : row.Field <decimal>("netord"); entity.oemixpct = row.IsNull("oemixpct") ? 0 : row.Field <int>("oemixpct"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.pdrecno = row.IsNull("pdrecno") ? 0 : row.Field <int>("pdrecno"); entity.pomixpct = row.IsNull("pomixpct") ? 0 : row.Field <int>("pomixpct"); entity.prevconv = row.IsNull("prevconv") ? decimal.Zero : row.Field <decimal>("prevconv"); entity.prevprod = row.IsNull("prevprod") ? string.Empty : row.Field <string>("prevprod"); entity.prevqtyord = row.IsNull("prevqtyord") ? decimal.Zero : row.Field <decimal>("prevqtyord"); entity.prevqtyship = row.IsNull("prevqtyship") ? decimal.Zero : row.Field <decimal>("prevqtyship"); entity.prevqtyshp = row.IsNull("prevqtyshp") ? decimal.Zero : row.Field <decimal>("prevqtyshp"); entity.prevunit = row.IsNull("prevunit") ? string.Empty : row.Field <string>("prevunit"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.pricefl = row.Field <bool>("pricefl"); entity.qtybundle = row.IsNull("qtybundle") ? decimal.Zero : row.Field <decimal>("qtybundle"); entity.qtycosted = row.IsNull("qtycosted") ? decimal.Zero : row.Field <decimal>("qtycosted"); entity.qtyprevbundle = row.IsNull("qtyprevbundle") ? decimal.Zero : row.Field <decimal>("qtyprevbundle"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.reqprod = row.IsNull("reqprod") ? string.Empty : row.Field <string>("reqprod"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.shpqtyoverfl = row.Field <bool>("shpqtyoverfl"); entity.stkqtycosted = row.IsNull("stkqtycosted") ? decimal.Zero : row.Field <decimal>("stkqtycosted"); entity.stkqtyord = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord"); entity.stkqtyship = row.IsNull("stkqtyship") ? decimal.Zero : row.Field <decimal>("stkqtyship"); entity.transdt = row.Field <DateTime?>("transdt"); entity.transproc = row.IsNull("transproc") ? string.Empty : row.Field <string>("transproc"); entity.transtm = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }