public static Icsprsrcsearchresults BuildIcsprsrcsearchresultsFromRow(DataRow row) { Icsprsrcsearchresults entity = new Icsprsrcsearchresults(); entity.restricttype = row.IsNull("restricttype") ? string.Empty : row.Field<string>("restricttype"); entity.column1value = row.IsNull("column1value") ? string.Empty : row.Field<string>("column1value"); entity.column1descrip = row.IsNull("column1descrip") ? string.Empty : row.Field<string>("column1descrip"); entity.prodlinevendno = row.IsNull("prodlinevendno") ? decimal.Zero : row.Field<decimal>("prodlinevendno"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field<string>("descrip"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field<string>("whse"); entity.startdt = row.Field<DateTime?>("startdt"); entity.expiredt = row.Field<DateTime?>("expiredt"); entity.activefl = row.Field<bool>("activefl"); entity.restrictovrfl = row.Field<bool>("restrictovrfl"); entity.icsprRowpointer = row.IsNull("icspr-rowpointer") ? string.Empty : row.Field<string>("icspr-rowpointer"); entity.icsprSrcrowpointer = row.IsNull("icspr-srcrowpointer") ? string.Empty : row.Field<string>("icspr-srcrowpointer"); entity.icsprRowid = row.Field<byte[]>("icspr-rowid").ToStringEncoded(); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field<string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field<string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field<string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field<string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field<string>("user5"); entity.user6 = row.Field<decimal?>("user6"); entity.user7 = row.Field<decimal?>("user7"); entity.user8 = row.Field<DateTime?>("user8"); entity.user9 = row.Field<DateTime?>("user9"); 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 UpdateRowFromIcsprsrcsearchresults(ref DataRow row, Icsprsrcsearchresults entity) { row.SetField("restricttype", entity.restricttype); row.SetField("column1value", entity.column1value); row.SetField("column1descrip", entity.column1descrip); row.SetField("prodlinevendno", entity.prodlinevendno); row.SetField("descrip", entity.descrip); row.SetField("whse", entity.whse); row.SetField("startdt", entity.startdt); row.SetField("expiredt", entity.expiredt); row.SetField("activefl", entity.activefl); row.SetField("restrictovrfl", entity.restrictovrfl); row.SetField("icspr-rowpointer", entity.icsprRowpointer); row.SetField("icspr-srcrowpointer", entity.icsprSrcrowpointer); row.SetField("icspr-rowid", entity.icsprRowid.ToByteArray()); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); row.SetField("userfield", entity.userfield); }