protected void Page_Load(object sender, EventArgs e) { //起始时间 var startTime = Request.Params["StartTime"]; //终止时间 var endTime = Request.Params["EndTime"]; //行ID var id = Request.Params["ID"]; //startTime = "2015-01-01"; //endTime = "2015-07-09"; //id = "1"; int rowNum = Convert.ToInt16(id) - 1; Dictionary <string, string> info = new Dictionary <string, string>(); try { if (startTime == null || endTime == null || id == null) { info.Add("参数StartTime,EndTime,ID不能为nul!", "举例:http://218.92.115.55/wlkg/Service/Supervise/Business/GetFreightBuinessDetail.aspx?StartTime=2015-01-01&EndTime=2015-07-09&ID=1"); Json = JsonConvert.SerializeObject(info); return; } startTime = startTime + " 00:00:00"; endTime = endTime + " 00:00:00"; GetData.AuthHeader head = new GetData.AuthHeader(); head.UserName = "******"; head.PassWord = "******"; GetData.WebServiceSoapClient fileDeal = new GetData.WebServiceSoapClient(); var dt = fileDeal.GetYWByTime_HYGS(head, startTime, endTime); if (dt.Rows.Count == 0) { info.Add("IsGet", "NO"); info.Add("Message", "ID错误!"); Json = JsonConvert.SerializeObject(info); return; } string[] nameArray = { "抵锚", "靠泊", "报关", "海关放行", "报检", "国检放行", "卸船开始", "卸船结束", "离港", "完船", "发运结束", "进出口", "内外贸", "船名", "航次", "提单号", "客户名称","货名", "部门", "操作员", "时间" }; //排序字符串 string order = string.Empty; order = nameArray[0] + "+" + nameArray[1] + "+" + nameArray[2] + "+" + nameArray[3] + "+" + nameArray[4] + "+" + nameArray[5] + "+" + nameArray[6] + "+" + nameArray[7] + "+" + nameArray[8] + "+" + nameArray[9] + "+" + nameArray[10] + "+" + nameArray[11] + "+" + nameArray[12] + "+" + nameArray[13] + "+" + nameArray[14] + "+" + nameArray[15] + "+" + nameArray[16] + "+" + nameArray[17] + "+" + nameArray[18] + "+" + nameArray[19] + "+" + nameArray[20]; const string FINISH = "已完成"; const string WAIT = "待办"; info.Add(nameArray[0], dt.Rows[rowNum]["ArrivedAnchorTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[1], dt.Rows[rowNum]["Berthingtime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[2], dt.Rows[rowNum]["CustomClearanceTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[3], dt.Rows[rowNum]["CustomFinalClearanceTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[4], dt.Rows[rowNum]["CIQInspectionTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[5], dt.Rows[rowNum]["CIQInspectionReleaseTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[6], dt.Rows[rowNum]["UnloadingTime_B"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[7], dt.Rows[rowNum]["UnloadingTime_E"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[8], dt.Rows[rowNum]["EtaSailingTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[9], dt.Rows[rowNum]["FinshVesselTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[10], dt.Rows[rowNum]["DeliveryEndTime"].ToString() == "1" ? FINISH : WAIT); info.Add(nameArray[11], dt.Rows[rowNum]["IEMark"].ToString()); info.Add(nameArray[12], dt.Rows[rowNum]["TradeType"].ToString()); info.Add(nameArray[13], dt.Rows[rowNum]["ChiVessel"].ToString()); info.Add(nameArray[14], dt.Rows[rowNum]["Voyage"].ToString()); info.Add(nameArray[15], dt.Rows[rowNum]["Blno"].ToString()); info.Add(nameArray[16], dt.Rows[rowNum]["ClientNameS"].ToString()); info.Add(nameArray[17], dt.Rows[rowNum]["CargoName"].ToString()); info.Add(nameArray[18], dt.Rows[rowNum]["DeptName"].ToString()); info.Add(nameArray[19], dt.Rows[rowNum]["Operator"].ToString()); info.Add(nameArray[20], dt.Rows[rowNum]["DTime"].ToString()); info.Add("Order", order); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { info.Add("IsGet", "NO"); info.Add("Message", "服务器异常:" + ex.Message); Json = JsonConvert.SerializeObject(info); } }
protected void Page_Load(object sender, EventArgs e) { //起始时间 var startTime = Request.Params["StartTime"]; //终止时间 var endTime = Request.Params["EndTime"]; //startTime = "2015-06-07 00:00:00"; //endTime = "2015-07-09 00:00:00"; Dictionary <string, Array> info = new Dictionary <string, Array>(); try { if (startTime == null || endTime == null) { string[] arry0 = new string[1]; arry0[0] = "举例:http://218.92.115.55/wlkg/Service/Supervise/Business/GetShippingBuiness.aspx?StartTime=2015-01-01&EndTime=2015-07-09"; info.Add("参数StartTime,EndTime不能为nul!", arry0); Json = JsonConvert.SerializeObject(info); return; } startTime = startTime + " 00:00:00"; endTime = endTime + " 00:00:00"; GetData.AuthHeader head = new GetData.AuthHeader(); head.UserName = "******"; head.PassWord = "******"; GetData.WebServiceSoapClient fileDeal = new GetData.WebServiceSoapClient(); var dt = fileDeal.GetYWByTime_CWGS(head, startTime, endTime); if (dt.Rows.Count == 0) { string[] arry0 = new string[1]; arry0[0] = "NO"; info.Add("IsGet", arry0); string[] arry1 = new string[1]; arry1[0] = "暂无数据!"; info.Add("Message", arry1); Json = JsonConvert.SerializeObject(info); return; } string[,] ary = new string[dt.Rows.Count, 6]; for (int iRow = 0; iRow < dt.Rows.Count; iRow++) { ary[iRow, 0] = (iRow + 1).ToString(); ary[iRow, 1] = Convert.ToString(dt.Rows[iRow]["TradeType"]); ary[iRow, 2] = Convert.ToString(dt.Rows[iRow]["ChiVessel"]); ary[iRow, 3] = Convert.ToString(dt.Rows[iRow]["Voyage"]); ary[iRow, 4] = Convert.ToString(dt.Rows[iRow]["Blno"]); ary[iRow, 5] = Convert.ToString(dt.Rows[iRow]["ClientNameS"]); } string[] arry2 = new string[1]; arry2[0] = "Yes"; info.Add("IsGet", arry2); info.Add("ShippingBuiness", ary); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { string[] arry0 = new string[1]; arry0[0] = "NO"; info.Add("IsGet", arry0); string[] arry1 = new string[1]; arry1[0] = "服务器异常:" + ex.Message; info.Add("Message", arry1); Json = JsonConvert.SerializeObject(info); } }
protected void Page_Load(object sender, EventArgs e) { //起始时间 var startTime = Request.Params["StartTime"]; //终止时间 var endTime = Request.Params["EndTime"]; //行ID var id = Request.Params["ID"]; //startTime = "2015-06-11"; //endTime = "2015-07-09"; //id = "1"; int rowNum = Convert.ToInt16(id) - 1; Dictionary <string, string> info = new Dictionary <string, string>(); try { if (startTime == null || endTime == null || id == null) { info.Add("参数StartTime,EndTime,ID不能为nul!", "举例:http://218.92.115.55/wlkg/Service/Supervise/Finance/GetShippingFinanceDetail.aspx?StartTime=2015-01-01&EndTime=2015-07-09&ID=1"); Json = JsonConvert.SerializeObject(info); return; } startTime = startTime + " 00:00:00"; endTime = endTime + " 00:00:00"; GetData.AuthHeader head = new GetData.AuthHeader(); head.UserName = "******"; head.PassWord = "******"; GetData.WebServiceSoapClient fileDeal = new GetData.WebServiceSoapClient(); var dt = fileDeal.GetPayReceiveBillByTime_CWGS(head, startTime, endTime); if (dt.Rows.Count == 0) { info.Add("IsGet", "NO"); info.Add("Message", "暂无数据!"); Json = JsonConvert.SerializeObject(info); return; } info.Add("进出口", dt.Rows[rowNum]["IEMark"].ToString()); info.Add("内外贸", dt.Rows[rowNum]["TradeType"].ToString()); info.Add("船名", dt.Rows[rowNum]["ChiVessel"].ToString()); info.Add("航次", dt.Rows[rowNum]["Voyage"].ToString()); info.Add("提单号", dt.Rows[rowNum]["Blno"].ToString()); info.Add("客户名称", dt.Rows[rowNum]["ClientNameS"].ToString()); info.Add("箱型箱量", dt.Rows[rowNum]["CtnNum"].ToString()); info.Add("应付人民币总额", dt.Rows[rowNum]["PayRMBAmounts"].ToString()); info.Add("应收人民币总额", dt.Rows[rowNum]["ReceiveRMBAmounts"].ToString()); info.Add("部门", dt.Rows[rowNum]["DTime"].ToString()); info.Add("时间", dt.Rows[rowNum]["DeptName"].ToString()); Json = JsonConvert.SerializeObject(info); } catch (Exception ex) { info.Add("IsGet", "NO"); info.Add("Message", "服务器异常:" + ex.Message); Json = JsonConvert.SerializeObject(info); } }