Пример #1
0
 //查询订单
 private void btnSelectOrder_Click(object sender, EventArgs e)
 {
     TokenSelect();
     flCompletedOrder.Controls.Clear();
     orderSelectAction.SelectOrder((str) => {
         if (str == "获取信息失败" || str == string.Empty)
         {
             MessageBox.Show("信息获取失败,请重试", "查询订单", MessageBoxButtons.OK, MessageBoxIcon.Information); return;
         }
         if (str.IndexOf("总张数") <= -1)
         {
             MessageBox.Show("没有符合查询条件的订单信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             int listCount = Regex.Matches(str, "table_clist").Count;
             string tmpStr = str.Replace(" ", "").Replace("\r\n", "").Replace("\t", "");
             for (int i = 0; i < listCount; i++)
             {
                 List <MyOrderData> newData = new List <MyOrderData>(GetOrderItems(tmpStr));
                 BindingList <MyOrderData> BindingResult = new BindingList <MyOrderData>(newData);
                 //_orderResult = GetOrderItems(tmpStr);
                 tmpStr = tmpStr.Replace(table, "");
                 DeterMineCall(() =>
                 {
                     OrderControl oc = new OrderControl();
                     oc.MyOrderNo    = newData[0].OrderID + " " + newData[0].OrderDate + " " + newData[0].OrderTotalPrice + " " + newData[0].TicketCount;
                     oc.MyDataSource = BindingResult;
                     oc.AutoSize     = false;
                     flCompletedOrder.Controls.Add(oc);
                 });
             }
         }
     }, _cookieContainer);
 }
Пример #2
0
 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);
         }
     });
 }
Пример #3
0
 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);
         }
     });
 }
Пример #4
0
 //查询订单
 private void btnSelectOrder_Click(object sender, EventArgs e)
 {
     TokenSelect();
     flCompletedOrder.Controls.Clear();
     orderSelectAction.SelectOrder((str) => {
         if (str == "获取信息失败" || str == string.Empty)
         { MessageBox.Show("信息获取失败,请重试", "查询订单", MessageBoxButtons.OK, MessageBoxIcon.Information); return; }
         if (str.IndexOf("总张数") <= -1)
             MessageBox.Show("没有符合查询条件的订单信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         else
         {
             int listCount = Regex.Matches(str, "table_clist").Count;
             string tmpStr = str.Replace(" ", "").Replace("\r\n", "").Replace("\t","");
             for (int i = 0; i < listCount; i++)
             {
                 List<MyOrderData> newData=new List<MyOrderData>(GetOrderItems(tmpStr));
                 BindingList<MyOrderData> BindingResult = new BindingList<MyOrderData>(newData);
                 //_orderResult = GetOrderItems(tmpStr);
                 tmpStr = tmpStr.Replace(table, "");
                 DeterMineCall(() =>
                 {
                     OrderControl oc = new OrderControl();
                     oc.MyOrderNo = newData[0].OrderID+" "+newData[0].OrderDate+" "+newData[0].OrderTotalPrice+" "+newData[0].TicketCount;
                     oc.MyDataSource = BindingResult;
                     oc.AutoSize = false;
                     flCompletedOrder.Controls.Add(oc);
                 });
             }
         }
     },_cookieContainer);
 }