Ejemplo n.º 1
0
 protected IReportInstanceSummary this[string key]
 {
     get
     {
         if (InterfaceInstanceList.ContainsKey(key))
         {
             return(InterfaceInstanceList[key]);
         }
         else
         {
             List <InterfaceInstance> interfaces  = InterfaceInstanceOperator.Instance.LoadListByName("IReportInstanceSummary");
             InterfaceInstance        newInstance = interfaces.Find(I => I.InterfaceInstanceName == key);
             if (newInstance != null)
             {
                 IReportInstanceSummary _interface = ReportInstanceSummaryBuilder.Instance.DoBuild(newInstance.Reference);
                 if (_interface != null)
                 {
                     AddHandle(newInstance.InterfaceInstanceName, _interface);
                     return(_interface);
                 }
             }
         }
         return(DefaultHandle);
     }
 }
Ejemplo n.º 2
0
 protected void AddHandle(string InstanceName, IReportInstanceSummary interfaceInstance)
 {
     if (!InterfaceInstanceList.ContainsKey(InstanceName))
     {
         InterfaceInstanceList.Add(InstanceName, interfaceInstance);
     }
     else
     {
         InterfaceInstanceList[InstanceName] = interfaceInstance;
     }
 }
Ejemplo n.º 3
0
        public ReportInstanceSummaryEngine()
        {
            //注册经营系统
            AddHandle("*", new DefaultReportInstanceSummary());
            //项目公司
            AddHandle("Project", new ReportInstanceSummary_Project());
            //注册集团总部
            AddHandle("Group", new ReportInstanceSummary_Group());
            //注册直属公司
            AddHandle("Directly", new ReportInstanceSummary_Directly());

            List <InterfaceInstance> interfaces = InterfaceInstanceOperator.Instance.LoadListByName("IReportInstanceSummary");

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