Sir
How to Consume Json
Please help me out to display : result.doc_no and itemlist array.
{
"success": true,
"message": "E-Way Bill is fetched successfully",
"result": {
"ewbNo": 321002661843,
"ewayBillDate": "22/06/2021 04:18:00 PM",
"genMode": "API",
"userGstin": "05AAACG2115R1ZN",
"supplyType": "O",
"subSupplyType": "1 ",
"docType": "INV",
"docNo": "3600A054HTO2AQ",
"docDate": "21/06/2021",
"fromGstin": "05AAACG2115R1ZN",
"fromTrdName": "Birla Carbon India Pvt Ltd-Production Unit Patalaganga",
"fromAddr1": "Village Lohop 410207 Patalganga",
"fromAddr2": "410207 Patalganga",
"fromPlace": "Ahemdabad",
"fromPincode": 380014,
"fromStateCode": 24,
"toGstin": "URP ",
"toTrdName": "Eu-Retec (Pvt) Ltd",
"toAddr1": "Eu-Retec (Pvt) Ltd-",
"toAddr2": "",
"toPlace": "Bidadi",
"toPincode": 562109,
"toStateCode": 29,
"totalValue": 57000.67,
"totInvValue": 57000.67,
"cgstValue": 0.00,
"sgstValue": 0.00,
"igstValue": 0.00,
"cessValue": 0.00,
"transporterId": "",
"transporterName": "TESTING TRAVEL",
"status": "ACT",
"actualDist": 100,
"noValidDays": 1,
"validUpto": "23/06/2021 11:59:00 PM",
"extendedTimes": 0,
"rejectStatus": "N",
"vehicleType": "R",
"actFromStateCode": 24,
"actToStateCode": 29,
"transactionType": 1,
"otherValue": 0,
"cessNonAdvolValue": 0,
"itemList": [
{
"itemNo": 1,
"productId": 0,
"productName": "N375-12173",
"productDesc": "PRINT INK",
"hsnCode": 28030010,
"quantity": 1.00,
"qtyUnit": "MTS",
"cgstRate": 0.000,
"sgstRate": 0.000,
"igstRate": 0.000,
"cessRate": 0.000,
"cessNonAdvol": 0,
"taxableAmount": 32000.00
},
{
"itemNo": 2,
"productId": 0,
"productName": "N375-122173",
"productDesc": "PRINT LIQUIED",
"hsnCode": 28030010,
"quantity": 1.00,
"qtyUnit": "MTS",
"cgstRate": 0.000,
"sgstRate": 0.000,
"igstRate": 0.000,
"cessRate": 0.000,
"cessNonAdvol": 0,
"taxableAmount": 25000.00
}
],
"VehiclListDetails": [
{
"updMode": "API",
"vehicleNo": "HR55K2091",
"fromPlace": "Ahemdabad",
"fromState": 24,
"tripshtNo": 0,
"userGSTINTransin": "05AAACG2115R1ZN",
"enteredDate": "22/06/2021 04:18:00 PM",
"transMode": "1",
"transDocNo": "",
"transDocDate": "22/06/2021",
"groupNo": "0"
}
]
}
}
IRestResponse response = client.Execute(request);
string ms = response.Content;
var EResponse = JsonConvert.DeserializeObject<root>(ms);
if (EResponse.success.ToString() == "true")
{
ClientScript.RegisterStartupScript(this.GetType(), "Pop", "OpenAlertSave();", true);
Mheader.Attributes.Add("style", "background-color:Green;color:white;font-stretch:ultra-expanded;font-size:medium;");
lblMsg.Text = EResponse.Data.fromTrdName.ToString();
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "Pop", "OpenAlertSave();", true);
Mheader.Attributes.Add("style", "background-color:orange;color:white;font-stretch:ultra-expanded;font-size:medium;");
lblMsg.Text = EResponse.message.ToString();
}
public class root
{
public string success { get; set; }
public string message { get; set; }
public result Data { get; set; }
}
public class result
{
public string ewbNo { get;set; }
public string ewayBillDate { get; set; }
public string userGstin { get; set; }
public string docNo { get; set; }
public string docDate { get; set; }
public string fromGstin { get; set; }
public string fromTrdName { get; set; }
public string fromAddr1 { get; set; }
public string fromAddr2 { get; set; }
public string fromPlace { get; set; }
public string fromPincode { get; set; }
public string fromStateCode { get; set; }
public string toTrdName { get; set; }
public string toAddr1 { get; set; }
public string toAddr2 { get; set; }
public string toPlace { get; set; }
public string toPincode { get; set; }
public string toStateCode { get; set; }
public string totalValue { get; set; }
public string validUpto { get; set; }
}