This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<HttpResponseMessage> Post([FromBody]Activity activity) | |
{ | |
if (activity.Type == ActivityTypes.Message) | |
{ | |
// Initiates the form flow | |
await Conversation.SendAsync(activity, MakeRootDialog); | |
} | |
else | |
{ | |
HandleSystemMessage(activity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CrmChatBot.CRM; | |
using CrmChatBot.Model; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Builder.Luis; | |
using Microsoft.Bot.Builder.Luis.Models; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Web; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CrmChatBot.CRM; | |
using CrmChatBot.Model; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Builder.FormFlow; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace CrmChatBot.FormFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void CreateTestDrive(TestDriveDetail testDrive, IOrganizationService crmService) | |
{ | |
var lead = new Microsoft.Xrm.Sdk.Entity(EntityName); | |
//lead.Attributes | |
lead.Attributes.Add(Field_Subject, $"Test Drive Request by {testDrive.CustomerName}"); | |
lead.Attributes.Add(Field_FirstName, testDrive.CustomerName); | |
lead.Attributes.Add(Field_Description, $@"Test drive request summary: | |
{Environment.NewLine}Car Make: {testDrive.CarMake}, | |
{Environment.NewLine}Car Model: {testDrive.CarModel}, | |
{Environment.NewLine}Requested Time: {testDrive.RequestedTime}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Web; | |
using Microsoft.Bot.Builder.Dialogs; | |
using Microsoft.Bot.Connector; | |
using System.Text.RegularExpressions; | |
using CrmChatBot.Model; | |
using CrmChatBot.CRM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CrmChatBot.Model | |
{ | |
[Serializable] | |
public class TestDriveDetail | |
{ | |
public string CarMake { get; set; } | |
public string CarModel { get; set; } | |
public string RequestedTime { get; set; } | |
public string CustomerName { get; set; } | |
public string PhoneNumber { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BotAuthentication] | |
public class MessagesController : ApiController | |
{ | |
/// <summary> | |
/// POST: api/Messages | |
/// Receive a message from a user and reply to it | |
/// </summary> | |
public async Task<HttpResponseMessage> Post([FromBody]Activity activity) | |
{ | |
if (activity.Type == ActivityTypes.Message) |