/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromKpcomponentslookupresults(ref DataRow row, Kpcomponentslookupresults entity) { row.SetField("comprod", entity.comprod); row.SetField("comptype", entity.comptype); row.SetField("qtyneeded", entity.qtyneeded); row.SetField("unit", entity.unit); row.SetField("reqfl", entity.reqfl); row.SetField("variablefl", entity.variablefl); row.SetField("subfl", entity.subfl); row.SetField("pricefl", entity.pricefl); row.SetField("printfl", entity.printfl); row.SetField("compboty", entity.compboty); row.SetField("refer", entity.refer); row.SetField("seqno", entity.seqno); row.SetField("updtallowedfl", entity.updtallowedfl); row.SetField("verno", entity.verno); row.SetField("verrefer", entity.verrefer); row.SetField("vercrtdt", entity.vercrtdt); row.SetField("brandcode", entity.brandcode); row.SetField("mfgprod", entity.mfgprod); row.SetField("msdsfl", entity.msdsfl); row.SetField("npfl", entity.npfl); row.SetField("rowid-kpsk", entity.rowidKpsk.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Kpcomponentslookupresults BuildKpcomponentslookupresultsFromRow(DataRow row) { Kpcomponentslookupresults entity = new Kpcomponentslookupresults(); entity.comprod = row.IsNull("comprod") ? string.Empty : row.Field <string>("comprod"); entity.comptype = row.IsNull("comptype") ? string.Empty : row.Field <string>("comptype"); entity.qtyneeded = row.IsNull("qtyneeded") ? decimal.Zero : row.Field <decimal>("qtyneeded"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.reqfl = row.IsNull("reqfl") ? string.Empty : row.Field <string>("reqfl"); entity.variablefl = row.IsNull("variablefl") ? string.Empty : row.Field <string>("variablefl"); entity.subfl = row.IsNull("subfl") ? string.Empty : row.Field <string>("subfl"); entity.pricefl = row.IsNull("pricefl") ? string.Empty : row.Field <string>("pricefl"); entity.printfl = row.IsNull("printfl") ? string.Empty : row.Field <string>("printfl"); entity.compboty = row.IsNull("compboty") ? string.Empty : row.Field <string>("compboty"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.updtallowedfl = row.Field <bool>("updtallowedfl"); entity.verno = row.IsNull("verno") ? 0 : row.Field <int>("verno"); entity.verrefer = row.IsNull("verrefer") ? string.Empty : row.Field <string>("verrefer"); entity.vercrtdt = row.Field <DateTime?>("vercrtdt"); entity.brandcode = row.IsNull("brandcode") ? string.Empty : row.Field <string>("brandcode"); entity.mfgprod = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod"); entity.msdsfl = row.Field <bool>("msdsfl"); entity.npfl = row.Field <bool>("npfl"); entity.rowidKpsk = row.Field <byte[]>("rowid-kpsk").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }