コード例 #1
0
        /// <summary>
        /// 生成会议清单安排
        /// </summary>
        /// <param name="list">会议信息</param>
        /// <param name="morningType">上午类型</param>
        /// <param name="afternoonType">下午类型</param>
        public static void ConferenceTrace(List <ConferenceInfo> list, SrvType morningType, SrvType afternoonType)
        {
            var instance = BaseConferenceSrv.CreateInstance(morningType);

            var morningConferences = instance.GetFittingConference(list);

            morningConferences.OutputConferenceTraceStr();

            var baseDatas = list.Except(morningConferences).ToList();

            var afternoonConferences = BaseConferenceSrv.CreateInstance(afternoonType).GetFittingConference(baseDatas);

            afternoonConferences.OutputConferenceTraceStr(false);
        }
コード例 #2
0
        private static BaseConferenceSrv CreateInstance(SrvType type)
        {
            BaseConferenceSrv instance = null;

            switch (type)
            {
            case SrvType.C_3_H_3:
                instance = new _3ConferencesTotal3HoursSrv();
                break;

            case SrvType.C_4_H_3:
                instance = new _4ConferencesTotal3HoursSrv();
                break;

            case SrvType.C_5_H_3:
                instance = new _5ConferencesTotal3HoursSrv();
                break;

            case SrvType.C_6_H_3:
                instance = new _6ConferencesTotal3HoursSrv();
                break;


            case SrvType.C_5_H_4:
                instance = new _5ConferencesTotal4HoursSrv();
                break;

            case SrvType.C_4_H_4:
                instance = new _4ConferencesTotal3HoursSrv();
                break;

            case SrvType.C_5_H_3_Point_5:
                instance = new _5ConferencesTotal3HalfWithLightning();
                break;

            default:
                throw new Exception("没有找到实现类!");
            }



            return(instance);
        }