Dear Sir
I am using asp.net C# and I am writing this script.
Please guide me how to consume data Table List to a Textbox and ChallanEntries to Gridview.
public class Main
{
public int statuscode { get; set; }
public string message { get; set; }
public string count { get; set; }
public List<data> data { get; set; }
}
public class data
{
public int Id { get; set; }
public string FromBranchCode { get; set; }
public string ChallanNo { get; set; }
public string Lrdate { get; set; }
public string RoyaltyPassNo { get; set; }
public string VehicleNo { get; set; }
public string TruckNo { get; set; }
public string Total { get; set; }
public string ToBranchCode { get; set; }
public string ToBranchName { get; set; }
public string Station { get; set; }
public string Package { get; set; }
public double Freight { get; set; }
public string CompanyName { get; set; }
public string CustFullName { get; set; }
public string BranchName { get; set; }
public string ConsignorName { get; set; }
public string ConsigneeName { get; set; }
public string RecieveDate { get; set; }
public string DeliveryDate { get; set; }
public string AuditedDate { get; set; }
public string Status { get; set; }
public string AdminName { get; set; }
public string GrossWeight { get; set; }
public string CNType { get; set; }
public string GodownName { get; set; }
public string PODFileName { get; set; }
public string UserType { get; set; }
public string DelPersonName { get; set; }
public string MrNo { get; set; }
public string IsClosingEntry { get; set; }
public string BookingTerms { get; set; }
public string CrossingVehicle { get; set; }
public string PartyInvoiceNo { get; set; }
public List<ChallanEntries> ChallanEntries { get; set; }
public string MachineQty { get; set; }
public string StationAddress { get; set; }
public string FromStation { get; set; }
public string PrivateMarkSingle { get; set; }
public string LRCarrierType { get; set; }
public string TrackingDetail { get; set; }
public string Dscc_ApprovalByText { get; set; }
}
public class ChallanEntries
{
public string BranchCode { get; set; }
public string ChallanNo { get; set; }
public string BranchName { get; set; }
public string ChallaDate { get; set; }
public string Station { get; set; }
public string ChlType { get; set; }
public string Rate { get; set; }
public string TotalWeight { get; set; }
public string VehNo { get; set; }
public string Frieght { get; set; }
public string BrokerName { get; set; }
public double Total { get; set; }
public string Balance { get; set; }
public string TransitDate { get; set; }
public string TotalPkgs { get; set; }
public string CarrierType { get; set; }
}
string Code = "";
string LrNo = txtCnsNo.Text.Trim();
RestClient restClient = new RestClient(string.Format("http://elplerp.in/api/LRInquiry.ashx?apiname=lrinquiry&code="+ Code + "&lrno="+ LrNo+ ""));
restClient.Timeout = -1;
RestRequest request = new RestRequest();
IRestResponse result = restClient.Execute(request);
Main Data = JsonConvert.DeserializeObject<Main>(result.Content);
{
"statuscode": "200",
"message": "success",
"data": [
[
{
"Id": 31314,
"FromBranchCode": "DEL",
"ChallanNo": "17389",
"Lrdate": "/Date(1601663400000)/",
"RoyaltyPassNo": null,
"VehicleNo": "",
"TruckNo": "GJ01HT8070",
"Total": 655.00,
"ToBranchCode": "JAI",
"ToBranchName": "JAIPUR",
"Station": "",
"Package": 6,
"Freight": 645.00,
"CompanyName": "UNIQUE RAJ DISTRIBUTORS",
"CustFullName": "UNIQUE RAJ DISTRIBUTORS",
"BranchName": "DELHI",
"ConsignorName": "VERMILION COSMETICS PRIVATE LIMITED",
"ConsigneeName": "UNIQUE RAJ DISTRIBTORS",
"RecieveDate": "05/10/2020",
"DeliveryDate": "05/10/2020",
"AuditedDate": "07/10/2020",
"Status": "Delivered",
"AdminName": "subhash jpr",
"GrossWeight": 250.000,
"CNType": "TBB",
"GodownName": "",
"PODFileName": "202010071758437389.jpg",
"UserType": "1",
"DelPersonName": "",
"MrNo": "",
"IsClosingEntry": 0,
"BookingTerms": "",
"CrossingVehicle": "",
"PartyInvoiceNo": "363",
"ChallanEntries": [
{
"BranchCode": "DEL",
"ChallanNo": "619",
"BranchName": "DELHI",
"ChallaDate": "/Date(1601663400000)/",
"Station": "",
"ChlType": "0",
"Rate": 0.00,
"TotalWeight": 4634.000,
"VehNo": "DL01LAC3230",
"Frieght": 0.00,
"BrokerName": "SAINI ROADLINES-DELHI",
"Total": 0.00,
"Balance": 0,
"TransitDate": "/Date(1601663400000)/",
"TotalPkgs": 222,
"CarrierType": ""
},
{
"BranchCode": "SNP",
"ChallanNo": "210",
"BranchName": "SONIPAT(KHARKHODA)",
"ChallaDate": "/Date(1601749800000)/",
"Station": "",
"ChlType": "0",
"Rate": 0.00,
"TotalWeight": 5665.000,
"VehNo": "GJ01HT8070",
"Frieght": 0.00,
"BrokerName": "A K T LOGISTICS",
"Total": 0.00,
"Balance": 0,
"TransitDate": "/Date(1601749800000)/",
"TotalPkgs": 331,
"CarrierType": ""
}
],
"MachineQty": 0.00,
"StationAddress": "PLOT NO, E-295 (A),ROAD NO 14, VKI AREA, NEAR POWER HOUSE CHAURAHA ,JAIPUR (RJ) 302013 \r\n",
"FromStation": "",
"PrivateMarkSingle": "",
"LRCarrierType": "",
"TrackingDetail": null,
"Dscc_ApprovalByText": ""
}
]
],
"count": 1
}