Dear Sir
How can i create in my page
"statuscode": "200",
"message": "success",
"data": [ ],
"count": 1
{
"statuscode": "200",
"message": "success",
"data": [
[
{
"Id": 82514,
"FromBranchCode": "BLR",
"ChallanNo": "1058395",
"Lrdate": "/Date(1627583400000)/",
"RoyaltyPassNo": null,
"VehicleNo": "",
"TruckNo": "MH04KF6442",
"Total": 3090.00,
"ToBranchCode": "VPI",
"ToBranchName": "VAPI",
"Station": "SARIGAM",
"Package": 8,
"Freight": 2112.00,
"CompanyName": "",
"CustFullName": "",
"BranchName": "BANGALORE",
"ConsignorName": "VARNA COATS PRIVATE LIMITED-BLR",
"ConsigneeName": "AHURA MAZDA MFG COMPANY PVT LTD-VPI",
"RecieveDate": "05/08/2021",
"DeliveryDate": "",
"AuditedDate": "06/08/2021",
"Status": "Out For Delivery",
"AdminName": "VAPI OFFICE ",
"GrossWeight": 352.000,
"CNType": "PAID",
"GodownName": "",
"PODFileName": "202108061704071058395.pdf",
"UserType": "1",
"DelPersonName": "",
"MrNo": "",
"IsClosingEntry": 0,
"BookingTerms": "",
"CrossingVehicle": "",
"PartyInvoiceNo": "12476-21,",
"ChallanEntries": [
{
"BranchCode": "BLR",
"ChallanNo": "598",
"BranchName": "NEELMANGLA",
"ChallaDate": "/Date(1627669800000)/",
"Station": "BHIWANDI",
"ChlType": "0",
"Rate": 0.00,
"TotalWeight": 7002.000,
"VehNo": "GJ01FT8007",
"Frieght": 0.00,
"BrokerName": "INTER INDIA ROADWAYS PVT LTD",
"Total": 0.00,
"Balance": 0,
"TransitDate": "/Date(1627669800000)/",
"TotalPkgs": 147,
"CarrierType": "",
"ReceiptDate": "/Date(1628068800000)/",
"UnloadingDate": "/Date(1628068800000)/",
"Chl_DriverName": "GYANRAKASH",
"DriverMobileNo": "",
"Chl_Id": 50743
},
{
"BranchCode": "MUM",
"ChallanNo": "1465",
"BranchName": "MUMBAI",
"ChallaDate": "/Date(1628015400000)/",
"Station": "VAPI",
"ChlType": "0",
"Rate": 0.00,
"TotalWeight": 352.000,
"VehNo": "MH04KF6442",
"Frieght": 0.00,
"BrokerName": "EDISAFE LOGISTICS PVT LTD",
"Total": 0.00,
"Balance": 0,
"TransitDate": "/Date(1628015400000)/",
"TotalPkgs": 8,
"CarrierType": "",
"ReceiptDate": "/Date(1628141760000)/",
"UnloadingDate": "/Date(1628141760000)/",
"Chl_DriverName": "RAHUL",
"DriverMobileNo": "",
"Chl_Id": 51061
}
],
"MachineQty": 0.00,
"StationAddress": "\"Shop No.29 Varun Complex Opp.Reliance Fresh,Nr Industrial Boiler Gidc Vapi-396195 \r\n\r\n\r\n\r\n",
"FromStation": "PEENYA",
"PrivateMarkSingle": "",
"LRCarrierType": "",
"TrackingDetail": null,
"Dscc_ApprovalByText": "",
"ModeOfTransportation": "",
"DriverDeliveryEntry": [
{
"Dri_BranchCode": "VPI",
"Dri_SrNo": "298",
"Dri_BranchName": "VAPI",
"Dri_Date": "/Date(1628101800000)/",
"Dri_Station": "silvassa , sarigam",
"Dri_CarrType": "0",
"Dri_Rate": 1600.00,
"Dri_TotalWeight": 1002.00,
"Dri_VehNo": "GJ15AT5484",
"Dri_Frieght": 1600.00,
"Dri_OwnerName": "ISLAM MOHAMMAD",
"Dri_Total": 1600,
"Dri_Balance": 1584.00,
"Dri_TransitDate": "/Date(1628101800000)/",
"Dri_TotalPkgs": 13,
"Dri_CarrierType": ""
}
]
}
]
],
"count": 1
}
Page Coding
<%@ WebHandler Language="C#" Class="DWBTracking" %>
using System;
using System.Web;
using System.Web.Services;
using Oracle.DataAccess.Client;
using System.IO;
using System.Data;
using Newtonsoft.Json;
public class DWBTracking : IHttpHandler
{
operation oper = new operation();
OracleDataReader dr;
DataSet ds;
string str = "";
string data;
public void ProcessRequest(HttpContext context)
{
string LrNumber = context.Request.QueryString["LrNumber"];
string json = this.GetCustomersJSON(LrNumber);
if (data != null)
{
context.Response.ContentType = "text/json";
context.Response.Write(json);
}
else
{
context.Response.TrySkipIisCustomErrors = true;
}
}
private string GetCustomersJSON(string LrNumber)
{
try
{
str = "SELECT DISTINCT JSON_OBJECT " +
"('BkgBranch' VALUE FROM_BRANCH_NAME ,'DWBNo' VALUE CNS_NO,'DWBDt' VALUE TO_CHAR(CNS_DATE,'dd-Mon-yyyy'),'ActWt' VALUE CNS.ACTUAL_WEIGHT,'ChgWt' VALUE CNS.CHARGED_WEIGHT, " +
"'TotPkgs' VALUE TOT_PKGS,'DlyBrCd' VALUE BR.BRANCH_NAME,'GoodsDesc' VALUE GOODS_DESC, " +
"'DoorDly' VALUE CASE WHEN DOOR_DLY='Y' THEN 'Yes' ELSE 'No' END,'CCAtch' VALUE CC_ATTACH,'DoorDlyNm' VALUE DOOR_DLY_TOWN_NAME, " +
"'CnsrName' VALUE CONSIGNOR_NAME,'CnseName' VALUE CNEE_NAME,'Segment' VALUE " +
"CASE WHEN CFM_FLAG='F' THEN 'FTL' WHEN CFM_FLAG='L' THEN 'LTL' WHEN CFM_FLAG='S' THEN 'Sundry' END ,'Packing' VALUE PACKING_METHOD,'BkgFrt' VALUE GRAND_TOTAL,'DlyPin' VALUE DLY_PIN_CODE, " +
"'Status' VALUE CASE WHEN MR.POD_IMAGE_NAME IS NOT NULL THEN 'Delivered' WHEN DELIVERY_FLG='X' THEN 'Out for Delivery' ELSE 'In Transit' END ,'POD' VALUE MR.POD_IMAGE_DIR||MR.POD_IMAGE_NAME, " +
"'ChallanEntries' VALUE (SELECT JSON_ARRAYAGG(JSON_OBJECT('ClnBrCd' VALUE BF.BRANCH_NAME,'ClnNo' VALUE CLN_CHALLAN_NO,'ClnDt' value TO_CHAR(CLNH.CHALLAN_DATE,'dd-Mon-yyyy'), 'ClnBrMust' value CF.BRANCH_NAME, 'clnvhl' VALUE LORRY_REGIS_NO , " +
"'Arvd' VALUE TO_CHAR(ULN.ARRIVAL_DATE,'dd-Mon-yyyy') )ORDER BY TO_DATE(CLNH.CHALLAN_DATE,'DD/MM/RRRR') ASC ) " +
"AS CLM FROM CT_CLNDTL CLND,CT_CLN CLNH,CT_CNS_PRINT CNS,CT_UNLDTL ULN,CM_BRANCH BF,CM_BRANCH CF WHERE " +
"CLND.CLN_DIV_CODE=CLNH.DIV_CODE AND CLND.CLN_CHALLAN_NO=CLNH.CHALLAN_NO AND CLND.CLN_CHALLAN_DATE=CLNH.CHALLAN_DATE AND CLND.CLN_BRANCH_BRANCH_CODE=CLNH.BRANCH_BRANCH_CODE " +
"AND CLND.CNS_BRANCH_BRANCH_CODE=CNS.BRANCH_BRANCH_CODE AND CLND.CNS_CNS_NO=CNS.CNS_NO AND CLND.CNS_CNS_DATE=CNS.CNS_DATE " +
"AND CLNH.CHALLAN_NO=ULN.CLN_NO(+) AND CLNH.CHALLAN_DATE=ULN.CLN_DATE(+) AND CNS.CNS_NO=ULN.CNS_CNS_NO(+) AND CNS.BRANCH_BRANCH_CODE=ULN.CNS_BRANCH_BRANCH_CODE(+) AND CNS.CNS_DATE=ULN.CNS_CNS_DATE(+) " +
"AND CLNH.BRANCH_BRANCH_CODE=BF.BRANCH_CODE AND CLNH.BRANCH_BRANCH_CODE_MUST=CF.BRANCH_CODE AND CLND.CNS_CNS_NO='" + LrNumber.ToUpper().Trim() + "' ))as data " +
"FROM CT_CNS_PRINT CNS,CM_BRANCH BR,CT_LCLDTL LCL,CT_MR_POD MR WHERE CNS.BRANCH_BRANCH_CODE_MUST=BR.BRANCH_CODE AND CNS.BRANCH_BRANCH_CODE=LCL.CNS_BRANCH_BRANCH_CODE(+) " +
"AND CNS.CNS_NO=LCL.CNS_CNS_NO(+) AND CNS.CNS_DATE=LCL.CNS_CNS_DATE(+) AND CNS.BRANCH_BRANCH_CODE=MR.CNS_BRANCH_BRANCH_CODE(+) " +
"AND CNS.CNS_NO=MR.CNS_CNS_NO(+) AND CNS.CNS_DATE=MR.CNS_CNS_DATE(+) AND CNS_NO='" + LrNumber.ToUpper().Trim() + "' ";
ds = oper.DTSET(str);
if (ds.Tables[0].Rows.Count > 0)
{
data = ds.Tables[0].DefaultView[0].Row["DATA"].ToString();
}
else
{
data = "No Data available ";
}
}
catch (Exception ex)
{
string s = ex.Message;
s = s.Replace("\"", "");
s = s.Replace("'", "");
s = s.Replace("\r", "\\r");
s = s.Replace("\n", "\\n");
data = s.ToString();
}
return data;
}
public bool IsReusable
{
get
{
return false;
}
}
}