public List <MarketDetaiedlMD> GetDetailedMarketMD() { List <MarketDetaiedlMD> result = new List <MarketDetaiedlMD>(); if (m_dataList == null) { m_dataList = GetDataList(); } /*List<JObject> ctyList = BusinessObject.BODataPool[BOIDEnum.Country].Cast<JObject>().ToList();*/ IEnumerator iterMkt = m_dataList.GetEnumerator(); string ctyTbName = GetTableName(BOIDEnum.Country); while (iterMkt.MoveNext()) { MarketMD mktMD = ((Newtonsoft.Json.Linq.JObject)iterMkt.Current).ConvertToTarget <MarketMD>(); MarketDetaiedlMD bo = new MarketDetaiedlMD(mktMD); string counties = string.Empty; foreach (int ctyId in mktMD.CountryIds) { JObject jo = m_dbConn.GetTableData(ctyTbName, ctyId); counties += jo.GetValue("Name").ToString() + ", "; } if (counties.Length > 0) { counties = counties.Substring(0, counties.Length - 2); } bo.Countries = counties; result.Add(bo); } return(result); }
private void MarketMDUpdateProc(Form form, object data) { BOMarket mktBo = (BOMarket)data; MarketDetaiedlMD detailedMkt = new MarketDetaiedlMD((MarketMD)mktBo.GetBOTable()); List<CountryMD> cty = mktBo.GetMktCountry(); detailedMkt.Countries = mktBo.GetCountryString(); if(objList.FocusedItem != null) { objList.GetItem(objList.FocusedItem.Index).RowObject = detailedMkt; } objList.RefreshSelectedObjects(); }
public List<MarketDetaiedlMD> GetDetailedMarketMD() { List<MarketDetaiedlMD> result = new List<MarketDetaiedlMD>(); if (m_dataList == null) { m_dataList = GetDataList(); } /*List<JObject> ctyList = BusinessObject.BODataPool[BOIDEnum.Country].Cast<JObject>().ToList();*/ IEnumerator iterMkt = m_dataList.GetEnumerator(); string ctyTbName = GetTableName(BOIDEnum.Country); while (iterMkt.MoveNext()) { MarketMD mktMD = ((Newtonsoft.Json.Linq.JObject)iterMkt.Current).ConvertToTarget<MarketMD>(); MarketDetaiedlMD bo = new MarketDetaiedlMD(mktMD); string counties = string.Empty; foreach (int ctyId in mktMD.CountryIds) { JObject jo = m_dbConn.GetTableData(ctyTbName, ctyId); counties += jo.GetValue("Name").ToString() + ", "; } if (counties.Length > 0) { counties = counties.Substring(0, counties.Length - 2); } bo.Countries = counties; result.Add(bo); } return result; }
private void NewMarketRetProc(Form form, object data) { BOMarket mktBo = (BOMarket)data; MarketDetaiedlMD detailedMkt = new MarketDetaiedlMD((MarketMD)mktBo.GetBOTable()); List<CountryMD> cty = mktBo.GetMktCountry(); detailedMkt.Countries = mktBo.GetCountryString(); objList.AddObject(detailedMkt); }