private void AddMarketSector(MarketSectorContract sector) { string query = string.Format("INSERT INTO MarketSector (MarketSectorID,MarketSectorName) VALUES ({0},'{1}');", sector.Key, sector.Name); this.database.ExecuteNonQuery( this.database.GetSqlStringCommand(query)); }
public MarketSegmentContract() { this.parentSector = null; this.name = string.Empty; this.code = string.Empty; }
public static MarketSector ToMarketSector(MarketSectorContract contract) { MarketSector sector = null; if (contract != null) { sector = new MarketSector(contract.Key, contract.Name); foreach (MarketSegmentContract segment in contract.Segments) { sector.Segments.Add(Converter.ToMarketSegment(segment)); } } return sector; }
public static MarketSectorContract ToMarketSectorContract(MarketSector sector) { MarketSectorContract contract = null; if (sector != null) { contract = new MarketSectorContract(); contract.Key = sector.Key; contract.Name = sector.Name; foreach (MarketSegment segment in sector.Segments) { contract.Segments.Add(Converter.ToMarketSegmentContract(segment)); } } return contract; }