public static Vaheaderaddchg BuildVaheaderaddchgFromRow(DataRow row) { Vaheaderaddchg entity = new Vaheaderaddchg(); entity.vano = row.IsNull("vano") ? 0 : row.Field <int>("vano"); entity.vasuf = row.IsNull("vasuf") ? 0 : row.Field <int>("vasuf"); 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.proddesc2 = row.IsNull("proddesc2") ? string.Empty : row.Field <string>("proddesc2"); entity.transtype = row.IsNull("transtype") ? string.Empty : row.Field <string>("transtype"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.verno = row.IsNull("verno") ? 0 : row.Field <int>("verno"); entity.vacfgfl = row.Field <bool>("vacfgfl"); entity.arpprodline = row.IsNull("arpprodline") ? string.Empty : row.Field <string>("arpprodline"); entity.arpvendno = row.IsNull("arpvendno") ? decimal.Zero : row.Field <decimal>("arpvendno"); entity.arpwhse = row.IsNull("arpwhse") ? string.Empty : row.Field <string>("arpwhse"); entity.cubes = row.IsNull("cubes") ? decimal.Zero : row.Field <decimal>("cubes"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.weight = row.IsNull("weight") ? decimal.Zero : row.Field <decimal>("weight"); entity.asknsoanfl = row.Field <bool>("asknsoanfl"); entity.cvanotes = row.IsNull("cvanotes") ? string.Empty : row.Field <string>("cvanotes"); entity.stagecdx = row.IsNull("stagecdx") ? string.Empty : row.Field <string>("stagecdx"); entity.cprodnotes = row.IsNull("cprodnotes") ? string.Empty : row.Field <string>("cprodnotes"); entity.cproddesc = row.IsNull("cproddesc") ? string.Empty : row.Field <string>("cproddesc"); entity.qtyship = row.IsNull("qtyship") ? decimal.Zero : row.Field <decimal>("qtyship"); entity.enterdt = row.Field <DateTime?>("enterdt"); entity.reqshipdt = row.Field <DateTime?>("reqshipdt"); entity.promisedt = row.Field <DateTime?>("promisedt"); entity.estcompdt = row.Field <DateTime?>("estcompdt"); entity.ordertypedspl = row.IsNull("ordertypedspl") ? string.Empty : row.Field <string>("ordertypedspl"); entity.orderaltno = row.IsNull("orderaltno") ? 0 : row.Field <int>("orderaltno"); entity.ordercustno = row.IsNull("ordercustno") ? decimal.Zero : row.Field <decimal>("ordercustno"); entity.custnotesfl = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl"); entity.ordercustpo = row.IsNull("ordercustpo") ? string.Empty : row.Field <string>("ordercustpo"); entity.stagecd = row.IsNull("stagecd") ? 0 : row.Field <int>("stagecd"); entity.ordertype = row.IsNull("ordertype") ? string.Empty : row.Field <string>("ordertype"); entity.rowid = row.Field <byte[]>("rowid").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 UpdateRowFromVaheaderaddchg(ref DataRow row, Vaheaderaddchg entity) { row.SetField("vano", entity.vano); row.SetField("vasuf", entity.vasuf); row.SetField("nonstockty", entity.nonstockty); row.SetField("shipprod", entity.shipprod); row.SetField("proddesc", entity.proddesc); row.SetField("proddesc2", entity.proddesc2); row.SetField("transtype", entity.transtype); row.SetField("whse", entity.whse); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("verno", entity.verno); row.SetField("vacfgfl", entity.vacfgfl); row.SetField("arpprodline", entity.arpprodline); row.SetField("arpvendno", entity.arpvendno); row.SetField("arpwhse", entity.arpwhse); row.SetField("cubes", entity.cubes); row.SetField("prodcat", entity.prodcat); row.SetField("weight", entity.weight); row.SetField("asknsoanfl", entity.asknsoanfl); row.SetField("cvanotes", entity.cvanotes); row.SetField("stagecdx", entity.stagecdx); row.SetField("cprodnotes", entity.cprodnotes); row.SetField("cproddesc", entity.cproddesc); row.SetField("qtyship", entity.qtyship); row.SetField("enterdt", entity.enterdt); row.SetField("reqshipdt", entity.reqshipdt); row.SetField("promisedt", entity.promisedt); row.SetField("estcompdt", entity.estcompdt); row.SetField("ordertypedspl", entity.ordertypedspl); row.SetField("orderaltno", entity.orderaltno); row.SetField("ordercustno", entity.ordercustno); row.SetField("custnotesfl", entity.custnotesfl); row.SetField("ordercustpo", entity.ordercustpo); row.SetField("stagecd", entity.stagecd); row.SetField("ordertype", entity.ordertype); row.SetField("rowid", entity.rowid.ToByteArray()); row.SetField("userfield", entity.userfield); }