public static Pdevloadcosts BuildPdevloadcostsFromRow(DataRow row) { Pdevloadcosts entity = new Pdevloadcosts(); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.arpvendno = row.IsNull("arpvendno") ? decimal.Zero : row.Field <decimal>("arpvendno"); entity.costtxt = row.IsNull("costtxt") ? string.Empty : row.Field <string>("costtxt"); entity.speccosttyth = row.IsNull("speccosttyth") ? string.Empty : row.Field <string>("speccosttyth"); entity.lastcost = row.IsNull("lastcost") ? decimal.Zero : row.Field <decimal>("lastcost"); entity.lastcostdt = row.Field <DateTime?>("lastcostdt"); entity.lastcostenabledfl = row.Field <bool>("lastcostenabledfl"); entity.replcost = row.IsNull("replcost") ? decimal.Zero : row.Field <decimal>("replcost"); entity.replcostdt = row.Field <DateTime?>("replcostdt"); entity.replcostenabledfl = row.Field <bool>("replcostenabledfl"); entity.avgcost = row.IsNull("avgcost") ? decimal.Zero : row.Field <decimal>("avgcost"); entity.avgcostdt = row.Field <DateTime?>("avgcostdt"); entity.avgcostenabledfl = row.Field <bool>("avgcostenabledfl"); entity.stndcost = row.IsNull("stndcost") ? decimal.Zero : row.Field <decimal>("stndcost"); entity.stndcostdt = row.Field <DateTime?>("stndcostdt"); entity.stndcostenabledfl = row.Field <bool>("stndcostenabledfl"); entity.rebatecost = row.IsNull("rebatecost") ? decimal.Zero : row.Field <decimal>("rebatecost"); entity.rebatecostdt = row.Field <DateTime?>("rebatecostdt"); entity.rebatecostenabledfl = row.Field <bool>("rebatecostenabledfl"); 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 UpdateRowFromPdevloadcosts(ref DataRow row, Pdevloadcosts entity) { row.SetField("prod", entity.prod); row.SetField("whse", entity.whse); row.SetField("arpvendno", entity.arpvendno); row.SetField("costtxt", entity.costtxt); row.SetField("speccosttyth", entity.speccosttyth); row.SetField("lastcost", entity.lastcost); row.SetField("lastcostdt", entity.lastcostdt); row.SetField("lastcostenabledfl", entity.lastcostenabledfl); row.SetField("replcost", entity.replcost); row.SetField("replcostdt", entity.replcostdt); row.SetField("replcostenabledfl", entity.replcostenabledfl); row.SetField("avgcost", entity.avgcost); row.SetField("avgcostdt", entity.avgcostdt); row.SetField("avgcostenabledfl", entity.avgcostenabledfl); row.SetField("stndcost", entity.stndcost); row.SetField("stndcostdt", entity.stndcostdt); row.SetField("stndcostenabledfl", entity.stndcostenabledfl); row.SetField("rebatecost", entity.rebatecost); row.SetField("rebatecostdt", entity.rebatecostdt); row.SetField("rebatecostenabledfl", entity.rebatecostenabledfl); row.SetField("userfield", entity.userfield); }