Exemple #1
0
 public static BusinessObject GetBO(BOIDEnum boid)
 {
     BusinessObject bo = null;
     switch (boid)
     {
         case BOIDEnum.BOSequence:
             bo = new BOSequence();
             break;
         case BOIDEnum.Country:
             bo = new BOCountry();
             break;
         case BOIDEnum.ProductGroup:
             bo = new BOProductGroup();
             break;
         case BOIDEnum.Market:
             bo = new BOMarket();
             break;
         case BOIDEnum.MarketDetail:
             bo = new BOMarketDetail();
             break;
         case BOIDEnum.SearchPlantf:
             bo = new BOBPSearchPlan();
             break;
         case BOIDEnum.Texture:
             bo = new BOTexture();
             break;
         case BOIDEnum.KeyWord:
             bo = new BOKeyWord();
             break;
         case BOIDEnum.KeyWordList:
             bo = new BOKWList();
             break;
         case BOIDEnum.Product:
             bo = new BOProduct();
             break;
         case BOIDEnum.PSearchPlan:
             bo = new BOProductSearchPlan();
             break;
         case BOIDEnum.PSearchResult:
             bo = new BOBPSearchResult();
             break;
         case BOIDEnum.BP:
             bo = new BOBP();
             break;
         default: break;
     }
     bo.Init();
     return bo;
 }
Exemple #2
0
        private void LoadGridData()
        {
            try
            {
                m_mktBO = (BOMarket)BOFactory.GetBO(BOIDEnum.Market);
                List<MarketDetaiedlMD> listObj = m_mktBO.GetDetailedMarketMD();
                //MarketMD newMkt = new MarketMD();
                //newMkt.ID = BusinessObject.GetBONextID(m_boId);
                //MarketDetaiedlMD newObj = new MarketDetaiedlMD(newMkt);
                //listObj.Add(newObj);

                objList.SetObjects(listObj);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
Exemple #3
0
        protected override bool OnCheckData(object data, BOAction action = BOAction.Add)
        {
            bool result = true;

            if (action == BOAction.Delete)
            {
                CountryMD       delMd   = (CountryMD)data;
                BOMarket        mktBo   = (BOMarket)BOFactory.GetBO(BOIDEnum.Market);
                List <MarketMD> mktList = mktBo.GetDataList().Cast <JObject>().Select(x => x.ConvertToTarget <MarketMD>()).ToList();;
                MarketMD        find    = mktList.Find(x => x.CountryIds.Contains(delMd.ID));
                if (find != null)
                {
                    result = false;
                    ReportStatusMessage(new SatusMessageInfo(MessageType.Error, MessageCode.RefenenceError, this,
                                                             "删除失败!国家 \"" + delMd.Name + "\" 在市场区域 \"" + find.Name + "\" 中被引用!"));
                }
            }
            else
            {
            }
            return(result);
        }