Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomerSupportTemplate"/> class.
        /// </summary>
        /// <param name="botServices">Bot services.</param>
        /// <param name="conversationState">Bot conversation state.</param>
        /// <param name="userState">Bot user state.</param>
        public CustomerSupportTemplate(BotStateService botStateService, T dialog, IBotServices botServices, ConversationState conversationState, UserState userState)
        {
            _conversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
            _userState         = userState ?? throw new ArgumentNullException(nameof(userState));
            _services          = botServices ?? throw new ArgumentNullException(nameof(botServices));
            _stateAccessor     = _conversationState.CreateProperty <CustomerSupportTemplateState>(nameof(CustomerSupportTemplateState));
            _botStateService   = botStateService ?? throw new System.ArgumentNullException(nameof(botStateService));
            _dialog            = dialog ?? throw new System.ArgumentNullException(nameof(dialog));

            // _dialogs = new DialogSet(_conversationState.CreateProperty<DialogState>(nameof(CustomerSupportTemplate)));
            // _dialogs.Add(new MainDialog(_services, _conversationState, _userState));
        }
Exemple #2
0
        public HelpDialog(string dialogId, BotStateService botStateService, IBotServices services) : base(dialogId)
        {
            _client          = new ServiceClient();
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var greetingSteps = new WaterfallStep[]
            {
                ShowHelp
            };

            InitialDialogId = $"{nameof(CheckPaymentDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(CheckPaymentDialog)}.mainFlow", greetingSteps));
        }
        public CommissionDialog(string dialogId, BotStateService botStateService, IBotServices services) : base(dialogId)
        {
            _client          = new ServiceClient();
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var checkCommission = new WaterfallStep[]
            {
                ShowCommissionDetails
            };

            InitialDialogId = $"{nameof(CommissionDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(CommissionDialog)}.mainFlow", checkCommission));
        }
Exemple #4
0
        public MainDialog(BotStateService botStateService, IBotServices services, ConversationState conversationState, UserState userState, PortalContext portalContext)
            : base(nameof(MainDialog))
        {
            _services          = services ?? throw new ArgumentNullException(nameof(services));
            _conversationState = conversationState;
            _userState         = userState;
            _portalContext     = portalContext;
            _stateAccessor     = _conversationState.CreateProperty <CustomerSupportTemplateState>(nameof(CustomerSupportTemplateState));
            _botStateService   = botStateService ?? throw new System.ArgumentNullException(nameof(botStateService));
            _client            = new DemoServiceClient();
            InitializeWaterfallDialog();

            RegisterDialogs();
        }
Exemple #5
0
        public CheckSpotDataDialog(string dialogId, BotStateService botStateService, IBotServices services) : base(dialogId)
        {
            _client          = new DemoServiceClient();
            _services        = services;
            _botStateService = botStateService ?? throw new System.ArgumentNullException(nameof(botStateService));

            var checkSpots = new WaterfallStep[]
            {
                PromptForOrderID,
                ShowSpotDetails
            };

            InitialDialogId = $"{nameof(CheckSpotDataDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(CheckSpotDataDialog)}.mainFlow", checkSpots));
            AddDialog(new TextPrompt($"{nameof(CheckSpotDataDialog)}.orderNumber"));
        }
Exemple #6
0
        public AdvertiserDialog(string dialogId, BotStateService botStateService, IBotServices services) : base(dialogId)
        {
            _client          = new ServiceClient();
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var checkAdvertiser = new WaterfallStep[]
            {
                PromptForAccountId,
                ShowAdvertiserDetails
            };

            InitialDialogId = $"{nameof(AdvertiserDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(AdvertiserDialog)}.mainFlow", checkAdvertiser));
            AddDialog(new TextPrompt($"{nameof(AdvertiserDialog)}.accountId"));
        }
        public LatestPaymentDialog(string dialogId, BotStateService botStateService, IBotServices services, PortalContext _portalContext) : base(dialogId)
        {
            _client          = new ServiceClient(_portalContext);
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var latestPayment = new WaterfallStep[]
            {
                PromptForAdvertiserCode,
                ShowLatestPayment
            };

            InitialDialogId = $"{nameof(LatestPaymentDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(LatestPaymentDialog)}.mainFlow", latestPayment));
            AddDialog(new TextPrompt($"{nameof(LatestPaymentDialog)}.advertisercode"));
        }
Exemple #8
0
        public CheckOrderPerformanceDialog(string dialogId, BotStateService botStateService, IBotServices services) : base(dialogId)
        {
            _client          = new ServiceClient();
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var checkOrderPerformance = new WaterfallStep[]
            {
                PromptForSelfServiceId,
                PromptForOrderNumber,
                ShowOrderPerformance
            };

            InitialDialogId = $"{nameof(CheckOrderPerformanceDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(CheckOrderPerformanceDialog)}.mainFlow", checkOrderPerformance));
            AddDialog(new TextPrompt($"{nameof(CheckOrderPerformanceDialog)}.orderNumber"));
            AddDialog(new TextPrompt($"{nameof(CheckOrderPerformanceDialog)}.selfServiceId"));
        }
Exemple #9
0
        public InvoiceSummaryDialog(string dialogId, BotStateService botStateService, IBotServices services, PortalContext _portalContext) : base(dialogId)
        {
            _client          = new ServiceClient(_portalContext);
            _services        = services;
            _botStateService = botStateService ?? throw new ArgumentNullException(nameof(botStateService));

            var invoiceSummary = new WaterfallStep[]
            {
                PromptForAdvertiserCode,
                PromptForBroadcastMonth,
                ShowInvoiceSummary
            };

            InitialDialogId = $"{nameof(InvoiceSummaryDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(InvoiceSummaryDialog)}.mainFlow", invoiceSummary));
            AddDialog(new TextPrompt($"{nameof(InvoiceSummaryDialog)}.advertisercode"));
            AddDialog(new TextPrompt($"{nameof(InvoiceSummaryDialog)}.broadcastmonth"));
        }
        public CheckOrderStatusDialog(string dialogId, BotStateService botStateService,
                                      IBotServices services
                                      //     IStatePropertyAccessor<CustomerSupportTemplateState> stateAccessor
                                      ) :  base(dialogId)
            // : base(services, nameof(CheckOrderStatusDialog), telemetryClient)
        {
            _client   = new ServiceClient();
            _services = services;
            // _stateAccessor = stateAccessor;
            _botStateService = botStateService ?? throw new System.ArgumentNullException(nameof(botStateService));

            var checkOrderStatus = new WaterfallStep[]
            {
                PromptForSelfServiceId,
                PromptForOrderNumber,
                ShowOrderStatus,
            };

            InitialDialogId = $"{nameof(CheckOrderStatusDialog)}.mainFlow";
            AddDialog(new WaterfallDialog($"{nameof(CheckOrderStatusDialog)}.mainFlow", checkOrderStatus));
            AddDialog(new TextPrompt($"{nameof(CheckOrderStatusDialog)}.orderNumber", GuidValidatorAsync));
            AddDialog(new TextPrompt($"{nameof(CheckOrderStatusDialog)}.ssid", GuidValidatorAsync));
        }