Пример #1
0
        private static int DoAnswer(AnswerOptions answer)
        {
            switch (answer.Execute())
            {
            case AnswerOptions.CallAnswer.NoCallToAnswerFound:
                LoggingUtil.Log(EventLogEntryType.Warning, EventLogIds.NoCallAtAll.Id(), "No call found.");
                return(0);

            case AnswerOptions.CallAnswer.LastCallAlreadyAnswered:
                LoggingUtil.Log(EventLogEntryType.Information, EventLogIds.CallAlreadyAnswered.Id(), "No new call to answer.");
                return(0);

            case AnswerOptions.CallAnswer.CallAnswered:
                LoggingUtil.Log(EventLogEntryType.Information, EventLogIds.CallAnswered.Id(), "New call answered.");
                return(0);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
        private static int DoCreate(CreateOptions create)
        {
            switch (create.Execute())
            {
            case CreateResult.AlreadyExists:
                LoggingUtil.Log(
                    EventLogEntryType.Error,
                    EventLogIds.CallAlreadyExists.Id(),
                    create.ScheduledDate == null
                            ? "A call already exists for today."
                            : $"A call already exists for that date ({create.UsedDate?.ToString(CallFolderManager.Format) ?? "Undefined date"}).");
                return(3);

            case CreateResult.Ok:
                LoggingUtil.Log(EventLogEntryType.Information, EventLogIds.CallCreated.Id(), "Call created.");
                return(0);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #3
0
 private static int DoExport(ExportOptions export)
 {
     export.Execute();
     LoggingUtil.Log(EventLogEntryType.Information, EventLogIds.DoNotEventLog.Id(), "Done.");
     return(0);
 }