我想创建一个 C# 基对象类,它代表下面的 Json 文档(这是一个调查表)。我可以轻松地完成前三三行,但我如何从"FormBody": { }
病房开始做嵌套的。
我已经看到人们在哪里使用public IDictionary<string, object> FormBody {get; set;}
. 我可以将它传递给 Json.Net 并让它为我填充对象类吗?或者还有其他方法吗?
{
"FormTitle": "Product 27",
"FormId": "CCC12345",
"Type": "forms",
"FormBody": {
"image": {
"width": 450,
"height": 200,
"title": "ACME Insurance",
"location": "Images/Forms/sample.jpg"
},
"heading1": {
"text": "Commercial Crime"
},
"body1": {
"text": "Important Notice, It is important that you as the proposer provide full and detailed answers to all the questions to enable the insurer to properly assess the risk involved and that the quote will be fair"
},
"heading2": {
"text": "How to use this form"
},
"body2": {
"text": "Please answer the questions listed below by either selecting an answer from the provided list/ contorl or enter the information into the designated field"
},
"categories": [
{
"name": "Gerenal Information",
"questions": [
{
"questionNumber": "1",
"dependencyLevel": {
"question": "0",
"answer": "0"
},
"questionText": "Are there any subsidiary companies that need to be included?",
"answerOptions": {
"control": {
"type": "groupCheckBox",
"selectionOptions": {
"availibleSelectionAmount": "2",
"options": [
"Yes",
"No"
]
}
}
},
"selectedAnswer": {
"selection": "Yes"
}
},
{
"questionNumber": "1.1",
"dependencyLevel": {
"question": "1",
"answer": "Yes"
},
"questionText": "How many subsidiaries need to be included?",
"questionInformation": {
"text": "Please enter a number"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"1",
"2",
"3",
"4",
"5"
]
}
}
},
"selectedAnswer": {
"selection": "1"
}
},
{
"questionNumber": "1.2",
"dependencyLevel": {
"question": "1",
"answer": "Yes"
},
"questionText": "Does the proposer have branches, subsidiaries, entities which are based outside RSA?",
"questionInformation": {
"text": "Please select one of the following"
},
"answerOptions": {
"control": {
"type": "groupCheckBox",
"selectionOptions": {
"availibleSelectionAmount": "2",
"options": [
"Yes",
"No"
]
}
}
},
"selectedAnswer": {
"selection": "No"
}
}
]
},
{
"name": "HR",
"questions": [
{
"questionNumber": "2",
"dependencyLevel": {
"question": "0",
"answer": "0"
},
"questionText": "How often does someone who is not normally involved in the payroll's update and preperation check on the payroll?",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"At least ounce a month",
"At least ounce a quater",
"At least every 6 months",
"Less than ounce a month",
"Less often"
]
}
}
},
"selectedAnswer": {
"selection": "At least ounce a month"
}
}
]
},
{
"name": "Accounting",
"information": "An owner/manger is an individual who owns most of the proposers shares and runs the business",
"questions": [
{
"questionNumber": "3",
"dependencyLevel": {
"question": "0",
"answer": "0"
},
"questionText": "Does the proposer's processes allow for someone to make payments without the owner/manager's knowledge",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"At least ounce a month",
"At least ounce a quater",
"At least every 6 months",
"Less than ounce a month",
"Less often"
]
}
}
},
"selectedAnswer": {
"selection": "At least ounce a month"
}
},
{
"questionNumber": "3.1",
"dependencyLevel": {
"question": "3",
"answer": "2"
},
"questionText": "Is dual authority required for EFTs?",
"questionInformation": {
"text": "Please select one"
},
"answerOptions": {
"control": {
"type": "checkBox",
"selectionOptions": {
"availibleSelectionAmount": "2",
"options": [
"Yes",
"No"
]
}
}
},
"selectedAnswer": {
"selection": "Yes"
}
},
{
"questionNumber": "3.2",
"dependencyLevel": {
"question": "3.1",
"answer": "Yes"
},
"questionText": "Are the people loading and releasing the payments both to check that the payments are made against a suitible authorisation document(e.g. signed purchase order, delivery note or similar)?",
"questionInformation": {
"text": "Please select one"
},
"answerOptions": {
"control": {
"type": "checkBox",
"selectionOptions": {
"availibleSelectionAmount": "2",
"options": [
"Yes",
"No"
]
}
}
},
"selectedAnswer": {
"selection": "Yes"
}
},
{
"questionNumber": "4",
"dependencyLevel": {
"question": "0",
"answer": "0"
},
"questionText": "Does the proposer have an annual formal budgeting process and is management approval required for payments which fall outside the budget?",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "4",
"options": [
"No formal budget",
"Yes, there is a budget but it is a guideline only and is not strictly enforced",
"Yes, there is a formal budget and any deviations require managemant approval",
"Yes, there is a formal budget but small purchases outside the budget do not require management approval"
]
}
}
},
"selectedAnswer": {
"selection": "Yes, there is a formal budget and any deviations require managemant approval"
}
}
]
},
{
"name": "Cash",
"questons": [
{
"questionNumber": "5",
"dependencyLevel": {
"question": "0",
"answer": "0"
},
"questionText": "What is the typical maximum amount of cash and near cash on hand at any one time? This includes petty cash, payments by debtors, creditor's payments, etc. Near cash includes coins and negotiables such as cheques, etc.",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"Less than R 50,000",
"Less than R 100,000",
"Less than R 250,000",
"Less than R 2,500,000",
"More than R 2,500,000"
]
}
}
},
"selectedAnswer": {
"selection": "More than R 2,500,000"
}
},
{
"questionNumber": "5.1",
"dependencyLevel": {
"question": "5",
"answer": "More than R 2,500,000"
},
"questionText": "Is the proposer paid in cash for goods/services?",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"Never",
"Less than once a month",
"Somethimes",
"Often",
"Very Often"
]
}
}
},
"selectedAnswer": {
"selection": "Very Often"
}
},
{
"questionNumber": "5.1.1",
"dependencyLevel": {
"question": "5.1",
"answer": "4"
},
"questionText": "How often are cash reconciliations done?",
"questionInformation": {
"text": "Please select one from the list"
},
"answerOptions": {
"control": {
"type": "dropDownList",
"selectionOptions": {
"availibleSelectionAmount": "5",
"options": [
"Never",
"Less than once a month",
"Somethimes",
"Often",
"Very Often"
]
}
}
},
"selectedAnswer": {
"selection": "Often"
}
}
]
}
]
}
}