Beispiel #1
0
        /*
         * 订单接口流程
         * 1./otn/login/checkUser 检查登陆
         * 2./otn/leftTicket/submitOrderRequest 提交订单请求 cookie参数有tk
         * 3./otn/confirmPassenger/getPassengerDTOs 乘车人信息
         * 4./otn/confirmPassenger/checkOrderInfo
         * 5./otn/confirmPassenger/getQueueCount
         * 6./otn/confirmPassenger/confirmSingleForQueue
         * 7./otn/confirmPassenger/queryOrderWaitTime
         * 8./otn/confirmPassenger/resultOrderForDcQueue
         */

        /// <summary>
        /// 订单流程接口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            OrderBll order     = new OrderBll();
            LoginBll login     = new LoginBll();
            QueryBll query     = new QueryBll();
            var      checkUser = login.PostCheckUser201909(out string json);

            if (!checkUser.result_code.Equals(0))
            {
                Log.Write(LogLevel.Error, json);
                return;
            }
            //var submitOrderRequest = order.SubmitOrderRequest();
            var getPassenger          = query.GetPassenger();
            var checkOrderInfo        = order.CheckOrderInfo();
            var getQueueCount         = order.GetQueueCount();
            var confirmSingleForQueue = order.ConfirmGoForQueue();

            order.QueryOrderWaitTime201909();
            order.ResultOrderForWcQueue();
        }
 /// <summary>
 ///  表格单元点击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dataTrain_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 0 && e.RowIndex != -1)
     {
         //获取cb_check的值
         var checkCell   = (DataGridViewCheckBoxCell)dataTrain.Rows[e.RowIndex].Cells["cb_check"];
         var trainNoCell = (DataGridViewTextBoxCell)dataTrain.Rows[e.RowIndex].Cells["TrainNo"];
         //var flag = Convert.ToBoolean(checkCell.Value);
         if (checkCell.Selected)
         {
             //rows.Cells["cb_check"].Value = false;
             //checkCell.Value = false;
             if (!TrainNumber.Items.Contains(trainNoCell.Value))
             {
                 TrainNumber.Items.Add(trainNoCell.Value);
             }
         }
         else
         {
             //rows.Cells["cb_check"].Value = true;
             //checkCell.Value = true;
             if (TrainNumber.Items.Contains(trainNoCell.Value))
             {
                 TrainNumber.Items.Remove(trainNoCell.Value);
             }
         }
     }
     else if (e.ColumnIndex == 23) //预定按钮
     {
         OrderBll       order       = new OrderBll();
         LoginBll       login       = new LoginBll();
         QueryBll       query       = new QueryBll();
         var            index       = e.RowIndex;
         var            departure   = departureStation.Text;
         var            arrivals    = arrivalsStation.Text;
         var            TrainId     = dataTrain.Rows[e.RowIndex].Cells["TrainId"].Value.ToString();
         ReqSubmitOrder submitOrder = new ReqSubmitOrder();
         submitOrder.toDate          = DateTime.Now.ToString("yyyy-MM-dd");
         submitOrder.fromDate        = departureDate.Value.ToString("yyyy-MM-dd");
         submitOrder.secretStr       = TrainId;
         submitOrder.fromStationName = departure;
         submitOrder.toStationName   = arrivals;
         submitOrder.wfdc_flag       = "dc";
         if (!(string.IsNullOrWhiteSpace(departure) && string.IsNullOrWhiteSpace(arrivals)))
         {
             var departureMsg = responses.FirstOrDefault(x => x.StationName == departure);
             var arrivalsMsg  = responses.FirstOrDefault(x => x.StationName == arrivals);
             submitOrder.fromStationShort = departureMsg.StationShort; // $"{departure},{departureMsg.StationShort}";
             submitOrder.toStationShort   = arrivalsMsg.StationShort;  // $"{arrivals},{arrivalsMsg.StationShort}";
         }
         var checkUser = login.PostCheckUser201909(out string json);
         if (checkUser.result_code.Equals(0))
         {
             var submitOrderRequest    = order.SubmitOrderRequest(submitOrder);
             var getPassenger          = query.GetPassenger();
             var checkOrderInfo        = order.CheckOrderInfo();
             var getQueueCount         = order.GetQueueCount();
             var confirmSingleForQueue = order.ConfirmGoForQueue();
             order.QueryOrderWaitTime201909();
             order.ResultOrderForWcQueue();
         }
     }
 }
Beispiel #3
0
        private void CheckOrderBtn_Click(object sender, EventArgs e)
        {
            string check = orderBll.CheckOrderInfo();

            txt.Text = check;
        }