public static Oefulfillmentresults BuildOefulfillmentresultsFromRow(DataRow row) { Oefulfillmentresults entity = new Oefulfillmentresults(); entity.selectedfl = row.Field <bool>("selectedfl"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.srcwhse = row.IsNull("srcwhse") ? string.Empty : row.Field <string>("srcwhse"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.sourcedqty = row.IsNull("sourcedqty") ? decimal.Zero : row.Field <decimal>("sourcedqty"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.unitconv = row.IsNull("unitconv") ? decimal.Zero : row.Field <decimal>("unitconv"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail"); entity.surplus = row.IsNull("surplus") ? decimal.Zero : row.Field <decimal>("surplus"); entity.nonstockfl = row.Field <bool>("nonstockfl"); entity.fullstockfl = row.Field <bool>("fullstockfl"); entity.shortstockfl = row.Field <bool>("shortstockfl"); entity.orignetavail = row.IsNull("orignetavail") ? decimal.Zero : row.Field <decimal>("orignetavail"); entity.origsurplus = row.IsNull("origsurplus") ? decimal.Zero : row.Field <decimal>("origsurplus"); entity.arpvendno = row.IsNull("arpvendno") ? decimal.Zero : row.Field <decimal>("arpvendno"); entity.arpwhse = row.IsNull("arpwhse") ? string.Empty : row.Field <string>("arpwhse"); entity.reqshipdt = row.Field <DateTime?>("reqshipdt"); entity.region = row.IsNull("region") ? string.Empty : row.Field <string>("region"); entity.tiedordernum = row.IsNull("tiedordernum") ? string.Empty : row.Field <string>("tiedordernum"); entity.tiedorderno = row.IsNull("tiedorderno") ? 0 : row.Field <int>("tiedorderno"); entity.tiedordersuf = row.IsNull("tiedordersuf") ? 0 : row.Field <int>("tiedordersuf"); entity.tiedlineno = row.IsNull("tiedlineno") ? 0 : row.Field <int>("tiedlineno"); entity.tiedqtyord = row.IsNull("tiedqtyord") ? decimal.Zero : row.Field <decimal>("tiedqtyord"); entity.tiedqtyship = row.IsNull("tiedqtyship") ? decimal.Zero : row.Field <decimal>("tiedqtyship"); entity.tiedstagecd = row.IsNull("tiedstagecd") ? 0 : row.Field <int>("tiedstagecd"); entity.tiedlinetype = row.IsNull("tiedlinetype") ? string.Empty : row.Field <string>("tiedlinetype"); entity.tiedvendno = row.IsNull("tiedvendno") ? decimal.Zero : row.Field <decimal>("tiedvendno"); entity.tiedwhse = row.IsNull("tiedwhse") ? string.Empty : row.Field <string>("tiedwhse"); entity.origruleused = row.IsNull("origruleused") ? string.Empty : row.Field <string>("origruleused"); entity.overruleused = row.IsNull("overruleused") ? string.Empty : row.Field <string>("overruleused"); 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 UpdateRowFromOefulfillmentresults(ref DataRow row, Oefulfillmentresults entity) { row.SetField("selectedfl", entity.selectedfl); row.SetField("lineno", entity.lineno); row.SetField("srcwhse", entity.srcwhse); row.SetField("seqno", entity.seqno); row.SetField("shipprod", entity.shipprod); row.SetField("qtyord", entity.qtyord); row.SetField("sourcedqty", entity.sourcedqty); row.SetField("unit", entity.unit); row.SetField("unitconv", entity.unitconv); row.SetField("netavail", entity.netavail); row.SetField("surplus", entity.surplus); row.SetField("nonstockfl", entity.nonstockfl); row.SetField("fullstockfl", entity.fullstockfl); row.SetField("shortstockfl", entity.shortstockfl); row.SetField("orignetavail", entity.orignetavail); row.SetField("origsurplus", entity.origsurplus); row.SetField("arpvendno", entity.arpvendno); row.SetField("arpwhse", entity.arpwhse); row.SetField("reqshipdt", entity.reqshipdt); row.SetField("region", entity.region); row.SetField("tiedordernum", entity.tiedordernum); row.SetField("tiedorderno", entity.tiedorderno); row.SetField("tiedordersuf", entity.tiedordersuf); row.SetField("tiedlineno", entity.tiedlineno); row.SetField("tiedqtyord", entity.tiedqtyord); row.SetField("tiedqtyship", entity.tiedqtyship); row.SetField("tiedstagecd", entity.tiedstagecd); row.SetField("tiedlinetype", entity.tiedlinetype); row.SetField("tiedvendno", entity.tiedvendno); row.SetField("tiedwhse", entity.tiedwhse); row.SetField("origruleused", entity.origruleused); row.SetField("overruleused", entity.overruleused); row.SetField("userfield", entity.userfield); }