I'm working on a bot where there are different categories and many sub categories . I am using enum to display and collect inputs. Here I need to display only the subcategories related to the category selected on the previous step how can we achieve this.
here is the code I'm working.
namespace ServiceDesk.Classes
{
public enum Category
{
hardware,
software,
email,
UserAdmin
};
public enum Subcategory
{
Desktop, KeyBoard, Laptop, Monitor, Mouse, Printer, Scanner, Server, Tablet
};
[Serializable]
public class HardwareQuery
{
[Prompt("Choose your {&} ? {||}")]
public Category? Categ;
[Prompt("Choose your {&} ? {||}")]
public Subcategory? SubCateg;
[Prompt("Please enter {&}")]
[Pattern(Utility.Phone)]
public string PhoneNumber { get; set; }
[Prompt("Please enter {&} ")]
[Pattern(Utility.Email)]
public string Email { get; set; }
[Prompt("Please provide your business need / {&} below")]
public string Justification { get; set; }
public static IForm<HardwareQuery> BuildForm()
{
return new FormBuilder<HardwareQuery>()
.Message("Welcome!")
.Build();
}
}
}