public static Wtesdetailline BuildWtesdetaillineFromRow(DataRow row) { Wtesdetailline entity = new Wtesdetailline(); entity.wtno = row.IsNull("wtno") ? 0 : row.Field <int>("wtno"); entity.wtsuf = row.IsNull("wtsuf") ? 0 : row.Field <int>("wtsuf"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.nonstockty = row.IsNull("nonstockty") ? string.Empty : row.Field <string>("nonstockty"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.commentfl = row.IsNull("commentfl") ? string.Empty : row.Field <string>("commentfl"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.stkqtyord = row.IsNull("stkqtyord") ? decimal.Zero : row.Field <decimal>("stkqtyord"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.stkqtyship = row.IsNull("stkqtyship") ? decimal.Zero : row.Field <decimal>("stkqtyship"); entity.bofl = row.Field <bool>("bofl"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.unitconv = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv"); entity.wtelrecid = row.IsNull("wtelrecid") ? 0 : row.Field <long>("wtelrecid"); entity.serlottype = row.IsNull("serlottype") ? string.Empty : row.Field <string>("serlottype"); entity.csunperstk = row.IsNull("csunperstk") ? decimal.Zero : row.Field <decimal>("csunperstk"); entity.specconv = row.IsNull("specconv") ? 0 : row.Field <int>("specconv"); entity.prccostper = row.IsNull("prccostper") ? string.Empty : row.Field <string>("prccostper"); entity.speccostty = row.IsNull("speccostty") ? string.Empty : row.Field <string>("speccostty"); entity.icspecrecno = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno"); entity.icstatustype = row.IsNull("icstatustype") ? string.Empty : row.Field <string>("icstatustype"); entity.nosnlotso = row.IsNull("nosnlotso") ? decimal.Zero : row.Field <decimal>("nosnlotso"); entity.binloc = row.IsNull("binloc") ? string.Empty : row.Field <string>("binloc"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.qtyunavail = row.IsNull("qtyunavail") ? decimal.Zero : row.Field <decimal>("qtyunavail"); entity.wmflship = row.Field <bool>("wmflship"); entity.wmqtyship = row.IsNull("wmqtyship") ? decimal.Zero : row.Field <decimal>("wmqtyship"); entity.icsnpofl = row.Field <bool>("icsnpofl"); entity.impliedlinefl = row.Field <bool>("impliedlinefl"); entity.msdsfl = row.Field <bool>("msdsfl"); entity.rowidWtel = row.Field <byte[]>("rowid-wtel").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtesdetailline(ref DataRow row, Wtesdetailline entity) { row.SetField("wtno", entity.wtno); row.SetField("wtsuf", entity.wtsuf); row.SetField("lineno", entity.lineno); row.SetField("nonstockty", entity.nonstockty); row.SetField("shipprod", entity.shipprod); row.SetField("proddesc", entity.proddesc); row.SetField("commentfl", entity.commentfl); row.SetField("qtyord", entity.qtyord); row.SetField("stkqtyord", entity.stkqtyord); row.SetField("qtyship", entity.qtyship); row.SetField("stkqtyship", entity.stkqtyship); row.SetField("bofl", entity.bofl); row.SetField("unit", entity.unit); row.SetField("unitconv", entity.unitconv); row.SetField("wtelrecid", entity.wtelrecid); row.SetField("serlottype", entity.serlottype); row.SetField("csunperstk", entity.csunperstk); row.SetField("specconv", entity.specconv); row.SetField("prccostper", entity.prccostper); row.SetField("speccostty", entity.speccostty); row.SetField("icspecrecno", entity.icspecrecno); row.SetField("icstatustype", entity.icstatustype); row.SetField("nosnlotso", entity.nosnlotso); row.SetField("binloc", entity.binloc); row.SetField("prodcost", entity.prodcost); row.SetField("qtyunavail", entity.qtyunavail); row.SetField("wmflship", entity.wmflship); row.SetField("wmqtyship", entity.wmqtyship); row.SetField("icsnpofl", entity.icsnpofl); row.SetField("impliedlinefl", entity.impliedlinefl); row.SetField("msdsfl", entity.msdsfl); row.SetField("rowid-wtel", entity.rowidWtel.ToByteArray()); row.SetField("userfield", entity.userfield); }