/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsrrankdata(ref DataRow row, Icsrrankdata entity) { row.SetField("whse", entity.whse); row.SetField("vendno", entity.vendno); row.SetField("prodline", entity.prodline); row.SetField("searchwhse", entity.searchwhse); row.SetField("newprodmonths", entity.newprodmonths); row.SetField("rankty", entity.rankty); row.SetField("ranks", entity.ranks); row.SetField("monthshistory", entity.monthshistory); row.SetField("newprodrank", entity.newprodrank); row.SetField("pcthitfl", entity.pcthitfl); row.SetField("pcthitcd", entity.pcthitcd); row.SetField("detailrankpct", entity.detailrankpct); row.SetField("recordtype", entity.recordtype); row.SetField("rankty-sensitive", entity.ranktySensitive); row.SetField("userfield", entity.userfield); }
public static Icsrrankdata BuildIcsrrankdataFromRow(DataRow row) { Icsrrankdata entity = new Icsrrankdata(); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.vendno = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno"); entity.prodline = row.IsNull("prodline") ? string.Empty : row.Field <string>("prodline"); entity.searchwhse = row.IsNull("searchwhse") ? string.Empty : row.Field <string>("searchwhse"); entity.newprodmonths = row.IsNull("newprodmonths") ? 0 : row.Field <int>("newprodmonths"); entity.rankty = row.IsNull("rankty") ? string.Empty : row.Field <string>("rankty"); entity.ranks = row.IsNull("ranks") ? 0 : row.Field <int>("ranks"); entity.monthshistory = row.IsNull("monthshistory") ? 0 : row.Field <int>("monthshistory"); entity.newprodrank = row.IsNull("newprodrank") ? string.Empty : row.Field <string>("newprodrank"); entity.pcthitfl = row.Field <bool>("pcthitfl"); entity.pcthitcd = row.IsNull("pcthitcd") ? string.Empty : row.Field <string>("pcthitcd"); entity.detailrankpct = row.IsNull("detailrankpct") ? decimal.Zero : row.Field <decimal>("detailrankpct"); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.ranktySensitive = row.Field <bool>("rankty-sensitive"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }