/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromKpewtiesresults(ref DataRow row, Kpewtiesresults entity) { row.SetField("seqno", entity.seqno); row.SetField("wono", entity.wono); row.SetField("wosuf", entity.wosuf); row.SetField("seqcomprod", entity.seqcomprod); row.SetField("notesfl", entity.notesfl); row.SetField("complevel", entity.complevel); row.SetField("comptype", entity.comptype); row.SetField("wotie", entity.wotie); row.SetField("wotietype", entity.wotietype); row.SetField("qtyneeded", entity.qtyneeded); row.SetField("comunit", entity.comunit); row.SetField("wono2", entity.wono2); row.SetField("wosuf2", entity.wosuf2); row.SetField("stage", entity.stage); row.SetField("kitdept", entity.kitdept); row.SetField("compdesc", entity.compdesc); row.SetField("leadtm", entity.leadtm); row.SetField("prodcost", entity.prodcost); row.SetField("qtyneededdspl", entity.qtyneededdspl); row.SetField("netavaildspl", entity.netavaildspl); row.SetField("qtyshortdspl", entity.qtyshortdspl); row.SetField("userfield", entity.userfield); }
public static Kpewtiesresults BuildKpewtiesresultsFromRow(DataRow row) { Kpewtiesresults entity = new Kpewtiesresults(); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.wono = row.IsNull("wono") ? 0 : row.Field <int>("wono"); entity.wosuf = row.IsNull("wosuf") ? 0 : row.Field <int>("wosuf"); entity.seqcomprod = row.IsNull("seqcomprod") ? string.Empty : row.Field <string>("seqcomprod"); entity.notesfl = row.IsNull("notesfl") ? string.Empty : row.Field <string>("notesfl"); entity.complevel = row.IsNull("complevel") ? 0 : row.Field <int>("complevel"); entity.comptype = row.IsNull("comptype") ? string.Empty : row.Field <string>("comptype"); entity.wotie = row.IsNull("wotie") ? string.Empty : row.Field <string>("wotie"); entity.wotietype = row.IsNull("wotietype") ? string.Empty : row.Field <string>("wotietype"); entity.qtyneeded = row.IsNull("qtyneeded") ? decimal.Zero : row.Field <decimal>("qtyneeded"); entity.comunit = row.IsNull("comunit") ? string.Empty : row.Field <string>("comunit"); entity.wono2 = row.IsNull("wono2") ? string.Empty : row.Field <string>("wono2"); entity.wosuf2 = row.IsNull("wosuf2") ? string.Empty : row.Field <string>("wosuf2"); entity.stage = row.IsNull("stage") ? string.Empty : row.Field <string>("stage"); entity.kitdept = row.IsNull("kitdept") ? string.Empty : row.Field <string>("kitdept"); entity.compdesc = row.IsNull("compdesc") ? string.Empty : row.Field <string>("compdesc"); entity.leadtm = row.IsNull("leadtm") ? 0 : row.Field <int>("leadtm"); entity.prodcost = row.IsNull("prodcost") ? decimal.Zero : row.Field <decimal>("prodcost"); entity.qtyneededdspl = row.IsNull("qtyneededdspl") ? decimal.Zero : row.Field <decimal>("qtyneededdspl"); entity.netavaildspl = row.IsNull("netavaildspl") ? decimal.Zero : row.Field <decimal>("netavaildspl"); entity.qtyshortdspl = row.IsNull("qtyshortdspl") ? decimal.Zero : row.Field <decimal>("qtyshortdspl"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }