/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromOelinepricingcriteria(ref DataRow row, Oelinepricingcriteria entity) { row.SetField("custno", entity.custno); row.SetField("shipto", entity.shipto); row.SetField("whse", entity.whse); row.SetField("prod", entity.prod); row.SetField("qtyord", entity.qtyord); row.SetField("unit", entity.unit); row.SetField("lineid", entity.lineid); row.SetField("orderno", entity.orderno); row.SetField("ordersuf", entity.ordersuf); row.SetField("customfield", entity.customfield); row.SetField("userfield", entity.userfield); row.SetField("price", entity.price); row.SetField("checknonstandprods", entity.checknonstandprods); }
public static Oelinepricingcriteria BuildOelinepricingcriteriaFromRow(DataRow row) { Oelinepricingcriteria entity = new Oelinepricingcriteria(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.qtyord = row.IsNull("qtyord") ? decimal.Zero : row.Field <decimal>("qtyord"); entity.unit = row.IsNull("unit") ? string.Empty : row.Field <string>("unit"); entity.lineid = row.IsNull("lineid") ? string.Empty : row.Field <string>("lineid"); entity.orderno = row.IsNull("orderno") ? 0 : row.Field <int>("orderno"); entity.ordersuf = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf"); entity.customfield = row.IsNull("customfield") ? string.Empty : row.Field <string>("customfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); entity.price = row.IsNull("price") ? decimal.Zero : row.Field <decimal>("price"); entity.checknonstandprods = row.Field <bool>("checknonstandprods"); return(entity); }