/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromWtsasearchcriteria(ref DataRow row, Wtsasearchcriteria entity) { row.SetField("recordtype", entity.recordtype); row.SetField("shipfmwhse", entity.shipfmwhse); row.SetField("shiptowhse", entity.shiptowhse); row.SetField("cono2", entity.cono2); 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("recordcountlimit", entity.recordcountlimit); row.SetField("userfield", entity.userfield); }
public static Wtsasearchcriteria BuildWtsasearchcriteriaFromRow(DataRow row) { Wtsasearchcriteria entity = new Wtsasearchcriteria(); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); 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.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.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }