public OrderForm(OrderInfo infoOrder) { this.InitializeComponent(); this.m_infoOrder = infoOrder; }
public string CheckOrder(OrderInfo orderInfo, VisitTime visit) { string result = string.Empty; try { this._httpItem.URL = "http://www.zj12580.cn/order/check"; this._httpItem.ResultType = ResultType.String; this._httpItem.Method = "POST"; this._httpItem.Allowautoredirect = false; this._httpItem.PostEncoding = System.Text.Encoding.UTF8; this._httpItem.Postdata = string.Format(this.m_orderInfo.CheckOrderPost, new object[] { visit.NumId, visit.Time, visit.Index, string.Concat(new string[] { visit.NumId, ",", visit.Time, ",", visit.Index }) }); this._httpItem.ContentType = "application/x-www-form-urlencoded"; HttpResult html = this._httpHelper.GetHtml(this._httpItem); if (html.StatusCode == System.Net.HttpStatusCode.OK) { this._htmlDoc.LoadHtml(html.Html); HtmlNode htmlNode = this._htmlDoc.DocumentNode.SelectSingleNode("/html/body/div[@id='middle']/div[@class='m_b']"); if (htmlNode != null) { HtmlNodeCollection htmlNodeCollection = htmlNode.SelectNodes("div[@class='m_r']/input"); if (htmlNodeCollection != null && htmlNodeCollection.Count == 15) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); for (int i = 0; i < 15; i++) { stringBuilder.Append(htmlNodeCollection[i].GetAttributeValue("name", "")); stringBuilder.Append("="); stringBuilder.Append(htmlNodeCollection[i].GetAttributeValue("value", "")); stringBuilder.Append("&"); } result = stringBuilder.ToString(); } } } } catch (System.Exception err) { Log.WriteError("订单确认失败", err); } return result; }