Articles → MICROSOFT BOT FRAMEWORK → Confirm Dialog In Microsoft Bot Framework
Confirm Dialog In Microsoft Bot Framework
Example
using Microsoft.Bot.Builder.FormFlow;
using System;
namespace Bot_Application1.Dialogs { [Serializable]
public class FormFlowDemo {
public string Name;
public string MobileNumber;
public string city;
public static IForm < FormFlowDemo > GetForm() {
return new FormBuilder < FormFlowDemo > ().Message("Welcome to support chat system. Please place your order").Field(nameof(city)).Confirm(async(state) =>{
double minOrder = 0;
switch (state.city) {
case "delhi":
minOrder = 100;
break;
case "gurugram":
minOrder = 150;
break;
case "noida":
minOrder = 250;
break;
}
return new PromptAttribute($ "For {state.city}, the minimum order is {minOrder}. Please confirm.");
}).Field(nameof(MobileNumber)).Field(nameof(Name)).Confirm("Thank you {Name}. Your order is placed. We will deliver your order to {city} in approx. 1 hour").Build();
}
}
}
Output
Click to Enlarge
Click to Enlarge