private void SetOrderSource(JObject returnString) { DeterMineCall(() => { flCompletedOrder.Controls.Clear(); for (int i = 0; i < returnString["data"]["OrderDTODataList"].Count(); i++) { var orderData = new List <MyOrderData>(); var orderControl = new OrderControl(); orderControl.MyOrderNo = returnString["data"]["OrderDTODataList"][i]["sequence_no"].ToString(); orderControl.MyOrderNo += " " + returnString["data"]["OrderDTODataList"][i]["from_station_name_page"].ToString().Replace(" ", ""); orderControl.MyOrderNo += "-" + returnString["data"]["OrderDTODataList"][i]["to_station_name_page"].ToString().Replace(" ", ""); orderControl.MyOrderNo += " " + returnString["data"]["OrderDTODataList"][i]["train_code_page"].ToString(); orderControl.MyOrderNo += " " + returnString["data"]["OrderDTODataList"][i]["array_passser_name_page"].ToString().Replace(" ", ""); orderControl.MyOrderNo += " " + returnString["data"]["OrderDTODataList"][i]["ticket_totalnum"].ToString() + "张"; orderControl.MyOrderNo += " " + returnString["data"]["OrderDTODataList"][i]["ticket_total_price_page"].ToString() + "元"; orderControl.MyOrderNo = orderControl.MyOrderNo.Replace("\r\n", "").Replace("\"", ""); for (int j = 0; j < returnString["data"]["OrderDTODataList"][i]["tickets"].Count(); j++) { var oData = new MyOrderData(returnString, j, i, true); orderData.Add(oData); } //orderControl.Width = 800; //orderControl.Height = 500; //Popup p = new Popup(orderControl); //p.Show(this); var bindingData = new BindingList <MyOrderData>(orderData); orderControl.MyDataSource = bindingData; orderControl.AutoSize = false; flCompletedOrder.Controls.Add(orderControl); } }); }
//获取未完成订单的列表 private List <MyOrderData> GetOrderItems(JObject obj) //object[] ticket, JavaScriptObject order) { var orderData = new List <MyOrderData>(); //<div class="jdan_tfont"> for (int i = 0; i < obj["data"]["orderDBList"][0]["tickets"].Count(); i++) { var oData = new MyOrderData(obj, i); orderData.Add(oData); } return(orderData); }
//获取未完成订单的列表 private List <MyOrderData> GetOrderItems(string html) { List <MyOrderData> orderData = new List <MyOrderData>();//<div class="jdan_tfont"> int length = 0; table = StringHelper.FindString(ref html, "<divclass=\"jdan_tfont\">", "</table>"); string tmpTable = StringHelper.FindString(ref html, "<divclass=\"jdan_tfont\">", "</table>"); length = Convert.ToInt16(Regex.Match(html, "(?<=总张数:)\\d+").ToString()); string[] trCollection = new string[length + 2]; int i = 0; while (tmpTable.IndexOf("<tr") > -1) { trCollection[i] = StringHelper.FindString(ref tmpTable, "<tr", "</tr>"); tmpTable = tmpTable.Replace(trCollection[i], ""); i++; } for (int a = 1; a < trCollection.Length - 1; a++) { var myData = new MyOrderData(trCollection[a]); if (table.IndexOf("订单号") > -1) { myData.OrderID = Regex.Match(table, "E\\d{9}").ToString(); myData.OrderDate = Regex.Match(table, "订单时间[::0-9\\-]+").ToString(); myData.OrderTotalPrice = Regex.Match(table, "总票价[::0-9\\.]+\\(元\\)").ToString(); myData.TicketCount = Regex.Match(table, "总张数[::0-9]+").ToString(); } orderData.Add(myData); if (myData.StatusInfo != "订票成功" && FailedOrderDetail.Flag == false) { FailedOrderDetail.Flag = true; FailedOrderDetail._Status = myData.Status; FailedOrderDetail._StatusInfo = myData.StatusInfo; FailedOrderDetail._TrainCode = myData.TrainCode; FailedOrderDetail._TrainDate = myData.TrainDate; FailedOrderDetail._TrainNo = myData.TrainNo; FailedOrderDetail._TrainStationInfo = myData.TrainStationInfo; } } return(orderData); }