コード例 #1
0
 protected ITargetEvaluation this[string key]
 {
     get
     {
         if (InterfaceInstanceList.ContainsKey(key))
         {
             return(InterfaceInstanceList[key]);
         }
         else
         {
             List <InterfaceInstance> interfaces  = InterfaceInstanceOperator.Instance.LoadListByName("IExcelParse");
             InterfaceInstance        newInstance = interfaces.Find(I => I.InterfaceInstanceName == key);
             if (newInstance != null)
             {
                 ITargetEvaluation _interface = TargetEvaluationBuilder.Instance.DoBuild(newInstance.Reference);
                 if (_interface != null)
                 {
                     AddHandle(newInstance.InterfaceInstanceName, _interface);
                     return(_interface);
                 }
             }
         }
         return(DefaultHandle);
     }
 }
コード例 #2
0
 protected void AddHandle(string InstanceName, ITargetEvaluation interfaceInstance)
 {
     if (!InterfaceInstanceList.ContainsKey(InstanceName))
     {
         InterfaceInstanceList.Add(InstanceName, interfaceInstance);
     }
     else
     {
         InterfaceInstanceList[InstanceName] = interfaceInstance;
     }
 }
コード例 #3
0
        public TargetEvaluationEngine()
        {
            //注册
            //正常计算
            AddHandle("*", new DefaultTargetEvaluation());
            AddHandle("2", new ProfitTargetEvaluation());
            AddHandle("3", new CostTargetEvaluation());
            AddHandle("Project", new ProjectTargetEvaluation()); //项目系统
            AddHandle("Group", new GroupjectTargetEvaluation()); //集团总部系统

            //重新计算
            AddHandle("R1", new DefaultResetTargetEvaluation());
            AddHandle("R4", new DefaultResetTargetEvaluation());
            AddHandle("R2", new ResetProfitTargetEvaluation());
            AddHandle("R3", new ResetCostTargetEvaluation());
            AddHandle("RProject", new ResetProjectTargetEvaluation()); //项目系统
            AddHandle("RGroup", new ResetGroupjectTargetEvaluation()); //集团总部系统

            //月度报告
            AddHandle("SUM_1", new DefaultSummaryTargetEvaluation());
            AddHandle("SUM_4", new DefaultSummaryTargetEvaluation());
            AddHandle("SUM_2", new ProfitSummaryTargetEvaluation());
            AddHandle("SUM_3", new CostSummaryTargetEvaluation());
            AddHandle("SUM_Group", new GroupSummaryTargetEvaluation());
            List <InterfaceInstance> interfaces = InterfaceInstanceOperator.Instance.LoadListByName("ITargetEvaluation");

            //注册扩展服务
            foreach (InterfaceInstance info in interfaces)
            {
                //根据InterfaceInstanceName,实现不同的处理方法
                ITargetEvaluation _interface = TargetEvaluationBuilder.Instance.DoBuild(info.Reference);
                if (_interface != null)
                {
                    AddHandle(info.InterfaceInstanceName, _interface);
                }
            }
        }