public static Shoplistchangetotals BuildShoplistchangetotalsFromRow(DataRow row) { Shoplistchangetotals entity = new Shoplistchangetotals(); entity.totalordered = row.IsNull("totalordered") ? decimal.Zero : row.Field <decimal>("totalordered"); entity.totalrecommend = row.IsNull("totalrecommend") ? decimal.Zero : row.Field <decimal>("totalrecommend"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromShoplistchangetotals(ref DataRow row, Shoplistchangetotals entity) { row.SetField("totalordered", entity.totalordered); row.SetField("totalrecommend", entity.totalrecommend); row.SetField("userfield", entity.userfield); }