/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromKpeuupdate(ref DataRow row, Kpeuupdate entity) { row.SetField("wono", entity.wono); row.SetField("wosuf", entity.wosuf); row.SetField("wonotesfl", entity.wonotesfl); row.SetField("shipprod", entity.shipprod); row.SetField("prodnotesfl", entity.prodnotesfl); row.SetField("proddesc", entity.proddesc); row.SetField("whse", entity.whse); row.SetField("verno", entity.verno); row.SetField("stagecd", entity.stagecd); row.SetField("tietype", entity.tietype); row.SetField("tieorderno", entity.tieorderno); row.SetField("tieordersuf", entity.tieordersuf); row.SetField("qtyorder", entity.qtyorder); row.SetField("unit", entity.unit); row.SetField("enterdt", entity.enterdt); row.SetField("rrarinits", entity.rrarinits); row.SetField("statuscd", entity.statuscd); row.SetField("kitdept", entity.kitdept); row.SetField("seqno", entity.seqno); row.SetField("origcost", entity.origcost); row.SetField("newvercost", entity.newvercost); row.SetField("withintolerance", entity.withintolerance); row.SetField("updatefl", entity.updatefl); row.SetField("userfield", entity.userfield); }
public static Kpeuupdate BuildKpeuupdateFromRow(DataRow row) { Kpeuupdate entity = new Kpeuupdate(); entity.wono = row.IsNull("wono") ? 0 : row.Field <int>("wono"); entity.wosuf = row.IsNull("wosuf") ? 0 : row.Field <int>("wosuf"); entity.wonotesfl = row.IsNull("wonotesfl") ? string.Empty : row.Field <string>("wonotesfl"); entity.shipprod = row.IsNull("shipprod") ? string.Empty : row.Field <string>("shipprod"); entity.prodnotesfl = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.verno = row.IsNull("verno") ? 0 : row.Field <int>("verno"); entity.stagecd = row.IsNull("stagecd") ? string.Empty : row.Field <string>("stagecd"); entity.tietype = row.IsNull("tietype") ? string.Empty : row.Field <string>("tietype"); entity.tieorderno = row.IsNull("tieorderno") ? 0 : row.Field <int>("tieorderno"); entity.tieordersuf = row.IsNull("tieordersuf") ? 0 : row.Field <int>("tieordersuf"); entity.qtyorder = row.IsNull("qtyorder") ? decimal.Zero : row.Field <decimal>("qtyorder"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.enterdt = row.Field <DateTime?>("enterdt"); entity.rrarinits = row.IsNull("rrarinits") ? string.Empty : row.Field <string>("rrarinits"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.kitdept = row.IsNull("kitdept") ? string.Empty : row.Field <string>("kitdept"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.origcost = row.IsNull("origcost") ? decimal.Zero : row.Field <decimal>("origcost"); entity.newvercost = row.IsNull("newvercost") ? decimal.Zero : row.Field <decimal>("newvercost"); entity.withintolerance = row.Field <bool>("withintolerance"); entity.updatefl = row.Field <bool>("updatefl"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }