/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtline(ref DataRow row, Wtline entity) { row.SetField("addonamt", entity.addonamt); row.SetField("addonmarkupcost", entity.addonmarkupcost); row.SetField("addonmarkuptype", entity.addonmarkuptype); row.SetField("addonpct", entity.addonpct); row.SetField("addontype", entity.addontype); row.SetField("approvety", entity.approvety); row.SetField("arpwhse", entity.arpwhse); row.SetField("bofl", entity.bofl); row.SetField("commentfl", entity.commentfl); row.SetField("cono", entity.cono); row.SetField("cono2", entity.cono2); row.SetField("crprod", entity.crprod); row.SetField("csunperstk", entity.csunperstk); row.SetField("cubes", entity.cubes); row.SetField("delayresrvfl", entity.delayresrvfl); row.SetField("duedt", entity.duedt); row.SetField("firstsuperwarnfl", entity.firstsuperwarnfl); row.SetField("icspecrecno", entity.icspecrecno); row.SetField("icspstatustype", entity.icspstatustype); row.SetField("linefl", entity.linefl); row.SetField("lineno", entity.lineno); row.SetField("maint-l", entity.maintL); row.SetField("netamt", entity.netamt); row.SetField("netavail", entity.netavail); row.SetField("nonstkdataok", entity.nonstkdataok); row.SetField("nonstockty", entity.nonstockty); row.SetField("nosnlots", entity.nosnlots); row.SetField("notesfl", entity.notesfl); row.SetField("orderaltno", entity.orderaltno); row.SetField("ordertype", entity.ordertype); row.SetField("prccostper", entity.prccostper); row.SetField("prod", entity.prod); row.SetField("prodcati", entity.prodcati); row.SetField("prodcato", entity.prodcato); row.SetField("prodcost", entity.prodcost); row.SetField("proddesc", entity.proddesc); row.SetField("proddesc1", entity.proddesc1); row.SetField("proddesc2", entity.proddesc2); row.SetField("prodinrcvfl", entity.prodinrcvfl); row.SetField("prodline", entity.prodline); row.SetField("qtyord", entity.qtyord); row.SetField("qtyship", entity.qtyship); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("reasunavty", entity.reasunavty); row.SetField("reqprod", entity.reqprod); row.SetField("serlottype", entity.serlottype); row.SetField("specconv", entity.specconv); row.SetField("speccostty", entity.speccostty); row.SetField("specprcst", entity.specprcst); row.SetField("stkqtyord", entity.stkqtyord); row.SetField("stkqtyship", entity.stkqtyship); row.SetField("stkunit", entity.stkunit); row.SetField("subupgrdty", entity.subupgrdty); row.SetField("surplus", entity.surplus); row.SetField("txtorderaltno", entity.txtorderaltno); row.SetField("unit", entity.unit); row.SetField("unitconv", entity.unitconv); row.SetField("usagefl", entity.usagefl); row.SetField("vendno", entity.vendno); row.SetField("weight", entity.weight); row.SetField("wtelrecid", entity.wtelrecid); row.SetField("wtelrowid", entity.wtelrowid); row.SetField("wtno", entity.wtno); row.SetField("wtsuf", entity.wtsuf); row.SetField("xrefprodty", entity.xrefprodty); row.SetField("idicsp", entity.idicsp); row.SetField("idicsp2", entity.idicsp2); row.SetField("idicsw", entity.idicsw); row.SetField("idicsw2", entity.idicsw2); row.SetField("idwtel", entity.idwtel); row.SetField("orgapprovety", entity.orgapprovety); row.SetField("orgbofl", entity.orgbofl); row.SetField("orgcatwtfl", entity.orgcatwtfl); row.SetField("orgcubes", entity.orgcubes); row.SetField("orgidicsp", entity.orgidicsp); row.SetField("orgidicsp2", entity.orgidicsp2); row.SetField("orgidicsw", entity.orgidicsw); row.SetField("orgidicsw2", entity.orgidicsw2); row.SetField("orgnetamt", entity.orgnetamt); row.SetField("orgnetord", entity.orgnetord); row.SetField("orgnonstockty", entity.orgnonstockty); row.SetField("orgnosnlots", entity.orgnosnlots); row.SetField("orgprod", entity.orgprod); row.SetField("orgprodcati", entity.orgprodcati); row.SetField("orgprodcato", entity.orgprodcato); row.SetField("orgprodcost", entity.orgprodcost); row.SetField("orgqtyord", entity.orgqtyord); row.SetField("orgqtyship", entity.orgqtyship); row.SetField("orgstkqtyord", entity.orgstkqtyord); row.SetField("orgstkqtyship", entity.orgstkqtyship); row.SetField("orgtotqtyord", entity.orgtotqtyord); row.SetField("orgtotqtyship", entity.orgtotqtyship); row.SetField("orgunit", entity.orgunit); row.SetField("orgunitchg", entity.orgunitchg); row.SetField("orgweight", entity.orgweight); row.SetField("orgmarkupaddon", entity.orgmarkupaddon); row.SetField("approvetyenabled", entity.approvetyenabled); row.SetField("boflenabled", entity.boflenabled); row.SetField("btnnonstockenabled", entity.btnnonstockenabled); row.SetField("btntiesenabled", entity.btntiesenabled); row.SetField("delayresrvflenabled", entity.delayresrvflenabled); row.SetField("linenoenabled", entity.linenoenabled); row.SetField("netamtenabled", entity.netamtenabled); row.SetField("prodcostenabled", entity.prodcostenabled); row.SetField("prodcatienabled", entity.prodcatienabled); row.SetField("prodenabled", entity.prodenabled); row.SetField("qtyordenabled", entity.qtyordenabled); row.SetField("qtyshipenabled", entity.qtyshipenabled); row.SetField("unitenabled", entity.unitenabled); row.SetField("usageflenabled", entity.usageflenabled); row.SetField("wlwhsechgfl", entity.wlwhsechgfl); row.SetField("crossrefcatflag", entity.crossrefcatflag); row.SetField("crossrefdata", entity.crossrefdata); row.SetField("crossrefflag", entity.crossrefflag); row.SetField("forcecorealloc", entity.forcecorealloc); row.SetField("forceserlotdialog", entity.forceserlotdialog); row.SetField("launchxrefprodscreenfl", entity.launchxrefprodscreenfl); row.SetField("optionalsuper", entity.optionalsuper); row.SetField("orderasneededflag", entity.orderasneededflag); row.SetField("serialicsnpofl", entity.serialicsnpofl); row.SetField("serialentryty", entity.serialentryty); row.SetField("lotentryty", entity.lotentryty); row.SetField("wmflship", entity.wmflship); row.SetField("wmqtyship", entity.wmqtyship); row.SetField("restrictovrfl", entity.restrictovrfl); row.SetField("restricterrmess", entity.restricterrmess); row.SetField("userfield", entity.userfield); row.SetField("user1", entity.user1); row.SetField("user10", entity.user10); row.SetField("user11", entity.user11); row.SetField("user12", entity.user12); row.SetField("user13", entity.user13); row.SetField("user14", entity.user14); row.SetField("user15", entity.user15); row.SetField("user16", entity.user16); row.SetField("user17", entity.user17); row.SetField("user18", entity.user18); row.SetField("user19", entity.user19); row.SetField("user2", entity.user2); row.SetField("user20", entity.user20); row.SetField("user21", entity.user21); row.SetField("user22", entity.user22); row.SetField("user23", entity.user23); row.SetField("user24", entity.user24); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); row.SetField("userchr1", entity.userchr1); row.SetField("userchr2", entity.userchr2); row.SetField("userchr3", entity.userchr3); row.SetField("userchr4", entity.userchr4); row.SetField("userdec1", entity.userdec1); row.SetField("userdec2", entity.userdec2); row.SetField("userdt1", entity.userdt1); row.SetField("userdt2", entity.userdt2); row.SetField("filler-1", entity.filler1); row.SetField("filler-2", entity.filler2); row.SetField("filler-3", entity.filler3); row.SetField("filler-4", entity.filler4); }
public static Wtline BuildWtlineFromRow(DataRow row) { Wtline entity = new Wtline(); entity.addonamt = row.IsNull("addonamt") ? decimal.Zero : row.Field<decimal>("addonamt"); entity.addonmarkupcost = row.IsNull("addonmarkupcost") ? decimal.Zero : row.Field<decimal>("addonmarkupcost"); entity.addonmarkuptype = row.IsNull("addonmarkuptype") ? string.Empty : row.Field<string>("addonmarkuptype"); entity.addonpct = row.IsNull("addonpct") ? decimal.Zero : row.Field<decimal>("addonpct"); entity.addontype = row.IsNull("addontype") ? string.Empty : row.Field<string>("addontype"); entity.approvety = row.IsNull("approvety") ? string.Empty : row.Field<string>("approvety"); entity.arpwhse = row.IsNull("arpwhse") ? string.Empty : row.Field<string>("arpwhse"); entity.bofl = row.Field<bool>("bofl"); entity.commentfl = row.Field<bool>("commentfl"); entity.cono = row.IsNull("cono") ? 0 : row.Field<int>("cono"); entity.cono2 = row.IsNull("cono2") ? 0 : row.Field<int>("cono2"); entity.crprod = row.IsNull("crprod") ? string.Empty : row.Field<string>("crprod"); entity.csunperstk = row.IsNull("csunperstk") ? decimal.Zero : row.Field<decimal>("csunperstk"); entity.cubes = row.IsNull("cubes") ? decimal.Zero : row.Field<decimal>("cubes"); entity.delayresrvfl = row.Field<bool>("delayresrvfl"); entity.duedt = row.Field<DateTime?>("duedt"); entity.firstsuperwarnfl = row.Field<bool>("firstsuperwarnfl"); entity.icspecrecno = row.IsNull("icspecrecno") ? 0 : row.Field<int>("icspecrecno"); entity.icspstatustype = row.IsNull("icspstatustype") ? string.Empty : row.Field<string>("icspstatustype"); entity.linefl = row.Field<bool>("linefl"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field<int>("lineno"); entity.maintL = row.IsNull("maint-l") ? string.Empty : row.Field<string>("maint-l"); entity.netamt = row.IsNull("netamt") ? decimal.Zero : row.Field<decimal>("netamt"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field<decimal>("netavail"); entity.nonstkdataok = row.Field<bool>("nonstkdataok"); entity.nonstockty = row.IsNull("nonstockty") ? string.Empty : row.Field<string>("nonstockty"); entity.nosnlots = row.IsNull("nosnlots") ? decimal.Zero : row.Field<decimal>("nosnlots"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field<string>("notesfl"); entity.orderaltno = row.IsNull("orderaltno") ? 0 : row.Field<int>("orderaltno"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field<string>("ordertype"); entity.prccostper = row.IsNull("prccostper") ? string.Empty : row.Field<string>("prccostper"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field<string>("prod"); entity.prodcati = row.IsNull("prodcati") ? string.Empty : row.Field<string>("prodcati"); entity.prodcato = row.IsNull("prodcato") ? string.Empty : row.Field<string>("prodcato"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field<decimal>("prodcost"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field<string>("proddesc"); entity.proddesc1 = row.IsNull("proddesc1") ? string.Empty : row.Field<string>("proddesc1"); entity.proddesc2 = row.IsNull("proddesc2") ? string.Empty : row.Field<string>("proddesc2"); entity.prodinrcvfl = row.Field<bool>("prodinrcvfl"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field<string>("prodline"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field<decimal>("qtyord"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field<decimal>("qtyship"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field<decimal>("qtyunavail"); entity.reasunavty = row.IsNull("reasunavty") ? string.Empty : row.Field<string>("reasunavty"); entity.reqprod = row.IsNull("reqprod") ? string.Empty : row.Field<string>("reqprod"); entity.serlottype = row.IsNull("serlottype") ? string.Empty : row.Field<string>("serlottype"); entity.specconv = row.IsNull("specconv") ? 0 : row.Field<int>("specconv"); entity.speccostty = row.IsNull("speccostty") ? string.Empty : row.Field<string>("speccostty"); entity.specprcst = row.IsNull("specprcst") ? string.Empty : row.Field<string>("specprcst"); entity.stkqtyord = row.IsNull("stkqtyord") ? decimal.Zero : row.Field<decimal>("stkqtyord"); entity.stkqtyship = row.IsNull("stkqtyship") ? decimal.Zero : row.Field<decimal>("stkqtyship"); entity.stkunit = row.IsNull("stkunit") ? string.Empty : row.Field<string>("stkunit"); entity.subupgrdty = row.IsNull("subupgrdty") ? string.Empty : row.Field<string>("subupgrdty"); entity.surplus = row.IsNull("surplus") ? decimal.Zero : row.Field<decimal>("surplus"); entity.txtorderaltno = row.IsNull("txtorderaltno") ? string.Empty : row.Field<string>("txtorderaltno"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field<string>("unit"); entity.unitconv = row.IsNull("unitconv") ? decimal.Zero : row.Field<decimal>("unitconv"); entity.usagefl = row.Field<bool>("usagefl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field<decimal>("vendno"); entity.weight = row.IsNull("weight") ? decimal.Zero : row.Field<decimal>("weight"); entity.wtelrecid = row.IsNull("wtelrecid") ? 0 : row.Field<long>("wtelrecid"); entity.wtelrowid = row.IsNull("wtelrowid") ? string.Empty : row.Field<string>("wtelrowid"); entity.wtno = row.IsNull("wtno") ? 0 : row.Field<int>("wtno"); entity.wtsuf = row.IsNull("wtsuf") ? 0 : row.Field<int>("wtsuf"); entity.xrefprodty = row.IsNull("xrefprodty") ? string.Empty : row.Field<string>("xrefprodty"); entity.idicsp = row.IsNull("idicsp") ? 0 : row.Field<long>("idicsp"); entity.idicsp2 = row.IsNull("idicsp2") ? 0 : row.Field<long>("idicsp2"); entity.idicsw = row.IsNull("idicsw") ? 0 : row.Field<long>("idicsw"); entity.idicsw2 = row.IsNull("idicsw2") ? 0 : row.Field<long>("idicsw2"); entity.idwtel = row.IsNull("idwtel") ? 0 : row.Field<long>("idwtel"); entity.orgapprovety = row.IsNull("orgapprovety") ? string.Empty : row.Field<string>("orgapprovety"); entity.orgbofl = row.Field<bool>("orgbofl"); entity.orgcatwtfl = row.Field<bool>("orgcatwtfl"); entity.orgcubes = row.IsNull("orgcubes") ? decimal.Zero : row.Field<decimal>("orgcubes"); entity.orgidicsp = row.IsNull("orgidicsp") ? 0 : row.Field<long>("orgidicsp"); entity.orgidicsp2 = row.IsNull("orgidicsp2") ? 0 : row.Field<long>("orgidicsp2"); entity.orgidicsw = row.IsNull("orgidicsw") ? 0 : row.Field<long>("orgidicsw"); entity.orgidicsw2 = row.IsNull("orgidicsw2") ? 0 : row.Field<long>("orgidicsw2"); entity.orgnetamt = row.IsNull("orgnetamt") ? decimal.Zero : row.Field<decimal>("orgnetamt"); entity.orgnetord = row.IsNull("orgnetord") ? decimal.Zero : row.Field<decimal>("orgnetord"); entity.orgnonstockty = row.IsNull("orgnonstockty") ? string.Empty : row.Field<string>("orgnonstockty"); entity.orgnosnlots = row.IsNull("orgnosnlots") ? decimal.Zero : row.Field<decimal>("orgnosnlots"); entity.orgprod = row.IsNull("orgprod") ? string.Empty : row.Field<string>("orgprod"); entity.orgprodcati = row.IsNull("orgprodcati") ? string.Empty : row.Field<string>("orgprodcati"); entity.orgprodcato = row.IsNull("orgprodcato") ? string.Empty : row.Field<string>("orgprodcato"); entity.orgprodcost = row.IsNull("orgprodcost") ? decimal.Zero : row.Field<decimal>("orgprodcost"); entity.orgqtyord = row.IsNull("orgqtyord") ? decimal.Zero : row.Field<decimal>("orgqtyord"); entity.orgqtyship = row.IsNull("orgqtyship") ? decimal.Zero : row.Field<decimal>("orgqtyship"); entity.orgstkqtyord = row.IsNull("orgstkqtyord") ? decimal.Zero : row.Field<decimal>("orgstkqtyord"); entity.orgstkqtyship = row.IsNull("orgstkqtyship") ? decimal.Zero : row.Field<decimal>("orgstkqtyship"); entity.orgtotqtyord = row.IsNull("orgtotqtyord") ? decimal.Zero : row.Field<decimal>("orgtotqtyord"); entity.orgtotqtyship = row.IsNull("orgtotqtyship") ? decimal.Zero : row.Field<decimal>("orgtotqtyship"); entity.orgunit = row.IsNull("orgunit") ? string.Empty : row.Field<string>("orgunit"); entity.orgunitchg = row.IsNull("orgunitchg") ? string.Empty : row.Field<string>("orgunitchg"); entity.orgweight = row.IsNull("orgweight") ? decimal.Zero : row.Field<decimal>("orgweight"); entity.orgmarkupaddon = row.IsNull("orgmarkupaddon") ? decimal.Zero : row.Field<decimal>("orgmarkupaddon"); entity.approvetyenabled = row.Field<bool>("approvetyenabled"); entity.boflenabled = row.Field<bool>("boflenabled"); entity.btnnonstockenabled = row.Field<bool>("btnnonstockenabled"); entity.btntiesenabled = row.Field<bool>("btntiesenabled"); entity.delayresrvflenabled = row.Field<bool>("delayresrvflenabled"); entity.linenoenabled = row.Field<bool>("linenoenabled"); entity.netamtenabled = row.Field<bool>("netamtenabled"); entity.prodcostenabled = row.Field<bool>("prodcostenabled"); entity.prodcatienabled = row.Field<bool>("prodcatienabled"); entity.prodenabled = row.Field<bool>("prodenabled"); entity.qtyordenabled = row.Field<bool>("qtyordenabled"); entity.qtyshipenabled = row.Field<bool>("qtyshipenabled"); entity.unitenabled = row.Field<bool>("unitenabled"); entity.usageflenabled = row.Field<bool>("usageflenabled"); entity.wlwhsechgfl = row.Field<bool>("wlwhsechgfl"); entity.crossrefcatflag = row.Field<bool>("crossrefcatflag"); entity.crossrefdata = row.IsNull("crossrefdata") ? string.Empty : row.Field<string>("crossrefdata"); entity.crossrefflag = row.Field<bool>("crossrefflag"); entity.forcecorealloc = row.Field<bool>("forcecorealloc"); entity.forceserlotdialog = row.Field<bool>("forceserlotdialog"); entity.launchxrefprodscreenfl = row.Field<bool>("launchxrefprodscreenfl"); entity.optionalsuper = row.Field<bool>("optionalsuper"); entity.orderasneededflag = row.Field<bool>("orderasneededflag"); entity.serialicsnpofl = row.Field<bool>("serialicsnpofl"); entity.serialentryty = row.IsNull("serialentryty") ? string.Empty : row.Field<string>("serialentryty"); entity.lotentryty = row.IsNull("lotentryty") ? string.Empty : row.Field<string>("lotentryty"); entity.wmflship = row.Field<bool>("wmflship"); entity.wmqtyship = row.IsNull("wmqtyship") ? decimal.Zero : row.Field<decimal>("wmqtyship"); entity.restrictovrfl = row.Field<bool>("restrictovrfl"); entity.restricterrmess = row.IsNull("restricterrmess") ? string.Empty : row.Field<string>("restricterrmess"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field<string>("userfield"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field<string>("user1"); entity.user10 = row.IsNull("user10") ? string.Empty : row.Field<string>("user10"); entity.user11 = row.IsNull("user11") ? string.Empty : row.Field<string>("user11"); entity.user12 = row.IsNull("user12") ? string.Empty : row.Field<string>("user12"); entity.user13 = row.IsNull("user13") ? string.Empty : row.Field<string>("user13"); entity.user14 = row.IsNull("user14") ? string.Empty : row.Field<string>("user14"); entity.user15 = row.IsNull("user15") ? string.Empty : row.Field<string>("user15"); entity.user16 = row.IsNull("user16") ? string.Empty : row.Field<string>("user16"); entity.user17 = row.IsNull("user17") ? string.Empty : row.Field<string>("user17"); entity.user18 = row.IsNull("user18") ? string.Empty : row.Field<string>("user18"); entity.user19 = row.IsNull("user19") ? string.Empty : row.Field<string>("user19"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field<string>("user2"); entity.user20 = row.IsNull("user20") ? string.Empty : row.Field<string>("user20"); entity.user21 = row.IsNull("user21") ? string.Empty : row.Field<string>("user21"); entity.user22 = row.IsNull("user22") ? string.Empty : row.Field<string>("user22"); entity.user23 = row.IsNull("user23") ? string.Empty : row.Field<string>("user23"); entity.user24 = row.IsNull("user24") ? string.Empty : row.Field<string>("user24"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field<string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field<string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field<string>("user5"); entity.user6 = row.Field<decimal?>("user6"); entity.user7 = row.Field<decimal?>("user7"); entity.user8 = row.Field<DateTime?>("user8"); entity.user9 = row.Field<DateTime?>("user9"); entity.userchr1 = row.IsNull("userchr1") ? string.Empty : row.Field<string>("userchr1"); entity.userchr2 = row.IsNull("userchr2") ? string.Empty : row.Field<string>("userchr2"); entity.userchr3 = row.IsNull("userchr3") ? string.Empty : row.Field<string>("userchr3"); entity.userchr4 = row.IsNull("userchr4") ? string.Empty : row.Field<string>("userchr4"); entity.userdec1 = row.IsNull("userdec1") ? decimal.Zero : row.Field<decimal>("userdec1"); entity.userdec2 = row.IsNull("userdec2") ? decimal.Zero : row.Field<decimal>("userdec2"); entity.userdt1 = row.Field<DateTime?>("userdt1"); entity.userdt2 = row.Field<DateTime?>("userdt2"); entity.filler1 = row.IsNull("filler-1") ? string.Empty : row.Field<string>("filler-1"); entity.filler2 = row.IsNull("filler-2") ? string.Empty : row.Field<string>("filler-2"); entity.filler3 = row.IsNull("filler-3") ? string.Empty : row.Field<string>("filler-3"); entity.filler4 = row.IsNull("filler-4") ? string.Empty : row.Field<string>("filler-4"); return entity; }