/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtsasearchresults(ref DataRow row, Wtsasearchresults entity) { row.SetField("recordtype", entity.recordtype); row.SetField("srcrowpointer", entity.srcrowpointer); row.SetField("shipfmwhse", entity.shipfmwhse); row.SetField("shiptowhse", entity.shiptowhse); row.SetField("cono2", entity.cono2); row.SetField("columnvalue-1", entity.columnvalue1); row.SetField("columnvalue-2", entity.columnvalue2); row.SetField("addontype", entity.addontype); row.SetField("addonamt", entity.addonamt); row.SetField("product", entity.product); row.SetField("prodline", entity.prodline); row.SetField("prodcat", entity.prodcat); row.SetField("prodprctype", entity.prodprctype); row.SetField("altprodgrp", entity.altprodgrp); row.SetField("wtsarowid", entity.wtsarowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Wtsasearchresults BuildWtsasearchresultsFromRow(DataRow row) { Wtsasearchresults entity = new Wtsasearchresults(); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.srcrowpointer = row.IsNull("srcrowpointer") ? string.Empty : row.Field <string>("srcrowpointer"); entity.shipfmwhse = row.IsNull("shipfmwhse") ? string.Empty : row.Field <string>("shipfmwhse"); entity.shiptowhse = row.IsNull("shiptowhse") ? string.Empty : row.Field <string>("shiptowhse"); entity.cono2 = row.IsNull("cono2") ? 0 : row.Field <int>("cono2"); entity.columnvalue1 = row.IsNull("columnvalue-1") ? string.Empty : row.Field <string>("columnvalue-1"); entity.columnvalue2 = row.IsNull("columnvalue-2") ? string.Empty : row.Field <string>("columnvalue-2"); entity.addontype = row.IsNull("addontype") ? string.Empty : row.Field <string>("addontype"); entity.addonamt = row.IsNull("addonamt") ? decimal.Zero : row.Field <decimal>("addonamt"); entity.product = row.IsNull("product") ? string.Empty : row.Field <string>("product"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); 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.wtsarowid = row.Field <byte[]>("wtsarowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }