/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromItemlottotals(ref DataRow row, Itemlottotals entity) { row.SetField("co_num", entity.coNum); row.SetField("wh_num", entity.whNum); row.SetField("abs_num", entity.absNum); row.SetField("item_desc", entity.itemDesc); row.SetField("total_lots", entity.totalLots); row.SetField("total_inventory", entity.totalInventory); row.SetField("total_locations", entity.totalLocations); row.SetField("itemlottotalsuserfield", entity.itemlottotalsuserfield); row.SetField("userfield", entity.userfield); }
public static Itemlottotals BuildItemlottotalsFromRow(DataRow row) { Itemlottotals entity = new Itemlottotals(); entity.coNum = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num"); entity.whNum = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num"); entity.absNum = row.IsNull("abs_num") ? string.Empty : row.Field <string>("abs_num"); entity.itemDesc = row.IsNull("item_desc") ? string.Empty : row.Field <string>("item_desc"); entity.totalLots = row.IsNull("total_lots") ? 0 : row.Field <int>("total_lots"); entity.totalInventory = row.IsNull("total_inventory") ? 0 : row.Field <int>("total_inventory"); entity.totalLocations = row.IsNull("total_locations") ? 0 : row.Field <int>("total_locations"); entity.itemlottotalsuserfield = row.IsNull("itemlottotalsuserfield") ? string.Empty : row.Field <string>("itemlottotalsuserfield"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }