/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOegetprodtierslist(ref DataRow row, Oegetprodtierslist entity) { row.SetField("prod", entity.prod); row.SetField("whse", entity.whse); row.SetField("descrip", entity.descrip); row.SetField("mfgprod", entity.mfgprod); row.SetField("prodtier", entity.prodtier); row.SetField("prodtiergrp", entity.prodtiergrp); row.SetField("prodtierdesc", entity.prodtierdesc); row.SetField("prodpreference", entity.prodpreference); row.SetField("prodpreferencedesc", entity.prodpreferencedesc); row.SetField("netavail", entity.netavail); row.SetField("price", entity.price); row.SetField("origprodfl", entity.origprodfl); row.SetField("vendno", entity.vendno); row.SetField("vendorname", entity.vendorname); row.SetField("userfield", entity.userfield); }
public static Oegetprodtierslist BuildOegetprodtierslistFromRow(DataRow row) { Oegetprodtierslist entity = new Oegetprodtierslist(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.descrip = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip"); entity.mfgprod = row.IsNull("mfgprod") ? string.Empty : row.Field <string>("mfgprod"); entity.prodtier = row.IsNull("prodtier") ? string.Empty : row.Field <string>("prodtier"); entity.prodtiergrp = row.IsNull("prodtiergrp") ? string.Empty : row.Field <string>("prodtiergrp"); entity.prodtierdesc = row.IsNull("prodtierdesc") ? string.Empty : row.Field <string>("prodtierdesc"); entity.prodpreference = row.IsNull("prodpreference") ? string.Empty : row.Field <string>("prodpreference"); entity.prodpreferencedesc = row.IsNull("prodpreferencedesc") ? string.Empty : row.Field <string>("prodpreferencedesc"); entity.netavail = row.IsNull("netavail") ? decimal.Zero : row.Field <decimal>("netavail"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.origprodfl = row.Field <bool>("origprodfl"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.vendorname = row.IsNull("vendorname") ? string.Empty : row.Field <string>("vendorname"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }