private void InitCountryGrid() { BOMarket mktBo = (BOMarket)m_bo; if (base.FormMode == NanCrm.FormMode.Add) { mktBo.Init(); } UpdateData(false); objList.DataSourceType = typeof(CountryMD); //this.olvcName.AspectGetter = delegate(object row) //{ // return "cfl"; //}; //this.olvcName.Renderer = new MappedImageRenderer(new Object[] { "cfl", Resources.ButtonChoose }); objList.SmallImageList = imageList; this.olvcName.ImageGetter = delegate(object row) { return(0); }; MarketMD mkt = (MarketMD)mktBo.GetBOTable(); foreach (int id in mkt.CountryIds) { BOCountry ctyBo = new BOCountry(); ctyBo.GetById(id); m_ctyList.Add((CountryMD)ctyBo.GetBOTable()); } CountryMD cty = new CountryMD(); cty.ID = -1; m_ctyList.Add(cty); objList.SetObjects(m_ctyList); }
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); }
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(); }