コード例 #1
0
        private ConditionBase CreateConditionByType(ConditionTypes ct)
        {
            ConditionBase c = null;

            switch (ct)
            {
            case ConditionTypes.DurationOfWorkingDay: c = new ConditionDurationOfWorkingDaysInRow(); break;

            case ConditionTypes.DurationOfWorkingTime: c = new ConditionDurationOfWorkingTime(); break;

            case ConditionTypes.DurationOfWorkingTimeByMonth: c = new ConditionDurationOfWorkingTimeOnMonth(); break;

            case ConditionTypes.DurationOfWorkingTimeByWeek: c = new ConditionDurationOfWorkingTimeOnWeek(); break;

            case ConditionTypes.DurationOfWorkingTimeSingleDay: c = new ConditionDurationOfWorkingTimeOnSingleDay(); break;

            case ConditionTypes.TimeBetweenPreviousDayWorkingTime: c = new ConditionTimeBetweenPreviousDayWorkingTime(); break;

            case ConditionTypes.WorkingOnFeast: c = new ConditionWorkingOnFeast(); break;

            case ConditionTypes.WorkingOnSpecialWeekdays: c = new ConditionWorkingOnSpecialWeekdays(); break;

            case ConditionTypes.WorkingOverEmployeeContractTime: c = new ConditionWorkingOverEmployeeContractTime(); break;

            case ConditionTypes.WorkingOverEmployeeCurrentBalanceHours: c = new ConditionWorkingOverEmployeeCurrentBalanceHours(); break;

            case ConditionTypes.WorkingTimeBetweenSeveralHours: c = new ConditionWorkingTimeBetweenSeveralHours(); break;

            case ConditionTypes.WorkingTimeOutOfOpeningTimeOfStore: c = new ConditionWorkingTimeOutOfOpeningStore(); break;

            case ConditionTypes.BalanceHoursReachesCertainAmount: c = new ConditionBalanceHoursReachesCertainAmount(); break;

            case ConditionTypes.BalanceHoursMustBeZeroEveryWeekMonthYear: c = new ConditionBalanceHoursMustBeZeroEveryWeekMonthYear(); break;

            case ConditionTypes.WorkingOnSunday: c = new ConditionWorkingOnSunday(); break;

            case ConditionTypes.WorkingOnSaturdayOrSunday: c = new ConditionWorkingOnSundayOrSaturday(); break;

            case ConditionTypes.SaldoOnCertainWeeks: c = new ConditionSaldoOnCertainWeeks(); break;
            }
            if (c != null)
            {
                c.Owner = this;
            }
            return(c);
        }
コード例 #2
0
ファイル: WorkingModelWrapper.cs プロジェクト: 5509850/baumax
        private ConditionBase CreateConditionByType(ConditionTypes ct)
        {
            ConditionBase c = null;
            switch (ct)
            {
                case ConditionTypes.DurationOfWorkingDay: c = new ConditionDurationOfWorkingDaysInRow(); break;
                case ConditionTypes.DurationOfWorkingTime: c = new ConditionDurationOfWorkingTime(); break;
                case ConditionTypes.DurationOfWorkingTimeByMonth: c = new ConditionDurationOfWorkingTimeOnMonth(); break;
                case ConditionTypes.DurationOfWorkingTimeByWeek: c = new ConditionDurationOfWorkingTimeOnWeek(); break;
                case ConditionTypes.DurationOfWorkingTimeSingleDay: c = new ConditionDurationOfWorkingTimeOnSingleDay(); break;
                case ConditionTypes.TimeBetweenPreviousDayWorkingTime: c = new ConditionTimeBetweenPreviousDayWorkingTime(); break;
                case ConditionTypes.WorkingOnFeast: c = new ConditionWorkingOnFeast(); break;
                case ConditionTypes.WorkingOnSpecialWeekdays: c = new ConditionWorkingOnSpecialWeekdays(); break;
                case ConditionTypes.WorkingOverEmployeeContractTime: c = new ConditionWorkingOverEmployeeContractTime(); break;
                case ConditionTypes.WorkingOverEmployeeCurrentBalanceHours: c = new ConditionWorkingOverEmployeeCurrentBalanceHours(); break;
                case ConditionTypes.WorkingTimeBetweenSeveralHours: c = new ConditionWorkingTimeBetweenSeveralHours(); break;
                case ConditionTypes.WorkingTimeOutOfOpeningTimeOfStore: c = new ConditionWorkingTimeOutOfOpeningStore(); break;
                case ConditionTypes.BalanceHoursReachesCertainAmount: c = new ConditionBalanceHoursReachesCertainAmount(); break;
                case ConditionTypes.BalanceHoursMustBeZeroEveryWeekMonthYear: c = new ConditionBalanceHoursMustBeZeroEveryWeekMonthYear(); break;
                case ConditionTypes.WorkingOnSunday: c = new ConditionWorkingOnSunday(); break;
                case ConditionTypes.WorkingOnSaturdayOrSunday: c = new ConditionWorkingOnSundayOrSaturday(); break;
                case ConditionTypes.SaldoOnCertainWeeks: c = new ConditionSaldoOnCertainWeeks(); break;

            }
            if (c != null)
                c.Owner = this;
            return c;
        }