// 搜尋未使用的訂單 private void button4_Click(object sender, EventArgs e) { bool success = false; string message = ""; SimpleService nfu_service = new SimpleService(); orderData = nfu_service.OrderSearchNotUse(out success, out message); if (success) { /* * Order m = JsonConvert.DeserializeObject<Order>(orderData); // 部分反序列化 * string name = m.id; * MessageBox.Show(name); */ JObject LinqSearch = JObject.Parse(orderData); // {} 物件json LINQ查詢 MessageBox.Show(LinqSearch["id"].ToString()); } else { MessageBox.Show(message); } }
// 搜尋已繳費及未完成之訂單info帳號未使用及以驗證 private bool SearchOrderNotUse() { bool success = false; string message = ""; orderDataJson = ""; try { SimpleService nfu_service = new SimpleService(); orderDataJson = nfu_service.OrderSearchNotUse(out success, out message); if (success) { JObject LinqSearchOrder = JObject.Parse(orderDataJson); // {} 物件json LINQ查詢 //MessageBox.Show(LinqSearchOrder["order_id"].ToString()); return(true); } else { richTextBox1.AppendText(message + "\n"); return(false); } } catch (Exception ex) { richTextBox1.AppendText("無法取得【搜尋未使用訂單之帳號】服務\n"); //MessageBox.Show("無法取得【搜尋未使用訂單之帳號】服務"); return(false); } }
// 搜尋已繳費及未完成之訂單info帳號未使用及以驗證 private bool SearchOrderNotUse() { bool success = false; string message = ""; orderDataJson = ""; try { SimpleService nfu_service = new SimpleService(); orderDataJson = nfu_service.OrderSearchNotUse(out success, out message); if (success) { JObject LinqSearchOrder = JObject.Parse(orderDataJson); // {} 物件json LINQ查詢 //MessageBox.Show(LinqSearchOrder["order_id"].ToString()); return true; } else { richTextBox1.AppendText(message + "\n"); return false; } } catch(Exception ex) { richTextBox1.AppendText("無法取得【搜尋未使用訂單之帳號】服務\n"); //MessageBox.Show("無法取得【搜尋未使用訂單之帳號】服務"); return false; } }