public static Icsprresults BuildIcsprresultsFromRow(DataRow row) { Icsprresults entity = new Icsprresults(); entity.columnlabel1 = row.IsNull("columnlabel-1") ? string.Empty : row.Field <string>("columnlabel-1"); entity.columnvalue1 = row.IsNull("columnvalue-1") ? string.Empty : row.Field <string>("columnvalue-1"); entity.columnlabel2 = row.IsNull("columnlabel-2") ? string.Empty : row.Field <string>("columnlabel-2"); entity.columnvalue2 = row.IsNull("columnvalue-2") ? string.Empty : row.Field <string>("columnvalue-2"); entity.startdt = row.Field <DateTime?>("startdt"); entity.expiredt = row.Field <DateTime?>("expiredt"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.restrictcd = row.IsNull("restrictcd") ? string.Empty : row.Field <string>("restrictcd"); entity.statuscddisplay = row.IsNull("statuscddisplay") ? string.Empty : row.Field <string>("statuscddisplay"); entity.activefl = row.Field <bool>("activefl"); entity.certrequiredfl = row.Field <bool>("certrequiredfl"); entity.restrictovrfl = row.Field <bool>("restrictovrfl"); entity.product = row.IsNull("product") ? string.Empty : row.Field <string>("product"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.prodcat = row.IsNull("prodcat") ? string.Empty : row.Field <string>("prodcat"); entity.prodprctype = row.IsNull("prodprctype") ? string.Empty : row.Field <string>("prodprctype"); entity.altprodgrp = row.IsNull("altprodgrp") ? string.Empty : row.Field <string>("altprodgrp"); entity.brandcd = row.IsNull("brandcd") ? string.Empty : row.Field <string>("brandcd"); entity.restricttype = row.IsNull("restricttype") ? string.Empty : row.Field <string>("restricttype"); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.statuscd = row.IsNull("statuscd") ? string.Empty : row.Field <string>("statuscd"); entity.restrictdesc = row.IsNull("restrictdesc") ? string.Empty : row.Field <string>("restrictdesc"); entity.columnhidden2 = row.Field <bool>("columnhidden-2"); 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.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 UpdateRowFromIcsprresults(ref DataRow row, Icsprresults entity) { row.SetField("columnlabel-1", entity.columnlabel1); row.SetField("columnvalue-1", entity.columnvalue1); row.SetField("columnlabel-2", entity.columnlabel2); row.SetField("columnvalue-2", entity.columnvalue2); row.SetField("startdt", entity.startdt); row.SetField("expiredt", entity.expiredt); row.SetField("whse", entity.whse); row.SetField("restrictcd", entity.restrictcd); row.SetField("statuscddisplay", entity.statuscddisplay); row.SetField("activefl", entity.activefl); row.SetField("certrequiredfl", entity.certrequiredfl); row.SetField("restrictovrfl", entity.restrictovrfl); row.SetField("product", entity.product); row.SetField("prodline", entity.prodline); row.SetField("vendno", entity.vendno); row.SetField("prodcat", entity.prodcat); row.SetField("prodprctype", entity.prodprctype); row.SetField("altprodgrp", entity.altprodgrp); row.SetField("brandcd", entity.brandcd); row.SetField("restricttype", entity.restricttype); row.SetField("recordtype", entity.recordtype); row.SetField("statuscd", entity.statuscd); row.SetField("restrictdesc", entity.restrictdesc); row.SetField("columnhidden-2", entity.columnhidden2); row.SetField("icspr-rowpointer", entity.icsprRowpointer); row.SetField("icspr-srcrowpointer", entity.icsprSrcrowpointer); 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); }