internal static FormDialog <LeadRegisterForm> MakeRootDialog(string channelId) { BuildFormDelegate <LeadRegisterForm> MakeLeadRegisterForm = null; var isSkype = channelId.ToLowerInvariant() == "skypeforbusiness"; if (isSkype) { MakeLeadRegisterForm = () => LeadRegisterForm.BuildFormSkype(); } else { MakeLeadRegisterForm = () => LeadRegisterForm.BuildForm(); } return(FormDialog.FromForm(MakeLeadRegisterForm, options: FormOptions.PromptInStart)); }
public static void CreateNewLead(CRMWebAPI api, LeadRegisterForm result) { Task.Run(async() => { dynamic data = new ExpandoObject(); data.subject = $"New Lead Registration Request by {result.Name}"; data.firstname = result.Name; data.description = $@"New Lead registration request summary: {Environment.NewLine}Product Requested : {result.Product}, {Environment.NewLine}Accounts Interested In: {result.Accounts}, {Environment.NewLine}Requester's Gender: {result.Gender}, {Environment.NewLine}Customer Name: {result.Name}, {Environment.NewLine}Total Registrations: {result.TotalAttendees}, {Environment.NewLine}Complementary Drink: {result.ComplementoryDrink}"; var leadGuid = await api.Create("leads", data); }).Wait(); }
public static async Task <DialogTurnResult> Run(this Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor <DialogState> accessor, CancellationToken cancellationToken = default(CancellationToken), DialogContext ctx = null) { var dialogSet = new DialogSet(accessor); dialogSet.Add(dialog); var dialogContext = await dialogSet.CreateContextAsync(turnContext, cancellationToken); var results = await dialogContext.ContinueDialogAsync(cancellationToken); if (results.Status == DialogTurnStatus.Empty) { object options = null; if (dialog is LeadRegisterDialog) { options = new LeadRegisterForm(); } return(await dialogContext.BeginDialogAsync(dialog.Id, options, cancellationToken)); } return(results); }