private void button1_Click(object sender, EventArgs e) { try { string tradingDateStr = this.dateTimePicker_Start.Value.ToString("yyyyMMdd"); string settlementInfo = m_orderDriver.GetSettlementInfo(tradingDateStr); this.rtxtSettlementInfo.Text = settlementInfo; } catch (Exception ex) { MessageBox.Show("读取结算单信息失败," + ex.Message); } }
private void SettlementInfoConfirmForm_Load(object sender, EventArgs e) { this.lblInfo.Text = "请仔细确认结算单,如有疑问请点击取消,并且联系您所在期货公司,[注意]取消后程序将自动退出!"; try { string settlementInfo = m_orderDriver.GetSettlementInfo(null); this.rtxtSettlementInfo.Text = settlementInfo; } catch (Exception ex) { MessageBox.Show("读取结算单信息失败," + ex.Message); this.btnOK.Enabled = false; } }
private void button1_Click(object sender, EventArgs e) { if (this.dateTimePicker1.Value > DateTime.Now) { MessageBox.Show("开始查询日期不能超过今天请重新输入"); return; } DateTime dateTime = new DateTime(this.dateTimePicker1.Value.Year, this.dateTimePicker1.Value.Month, this.dateTimePicker1.Value.Day, 0, 0, 0); for (DateTime dateTimeTemp = dateTime; dateTimeTemp <= new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); dateTimeTemp = dateTimeTemp.AddDays(1)) { try { string tradingDateStr = dateTimeTemp.ToString("yyyyMMdd"); string settlementInfo = m_orderDriver.GetSettlementInfo(tradingDateStr); if (settlementInfo.Equals("")) { continue; } string[] strInfoTemp = settlementInfo.Split('\n'); string custormQualityInfo = strInfoTemp[15]; string cusSpilt = ""; Debug.Assert(custormQualityInfo.Count() > 0); foreach (char c in custormQualityInfo) { if (c == ' ' || c == '\r') { continue; } cusSpilt = cusSpilt + c; } string qualityStr = ""; for (int i = cusSpilt.Count() - 1; i >= 0; i--) { if ((cusSpilt[i] >= '0' && cusSpilt[i] <= '9') || cusSpilt[i] == '.') { qualityStr = qualityStr.Insert(0, cusSpilt[i].ToString()); } else { break; } } //弄出资金的值 m_dateQuality[tradingDateStr] = Convert.ToDecimal(qualityStr); this.label_settlementInfo.Text = string.Format("**正在从保证金监控中心下载结算单信息,交易日:{0}", tradingDateStr); } catch (Exception ex) { MessageBox.Show("读取结算单信息失败," + ex.Message); } } //m_dateQuality["20170901"] = 11233; //m_dateQuality["20170902"] = 11236; //m_dateQuality["20170903"] = 12433; //m_dateQuality["20170904"] = 15677; //m_dateQuality["20170905"] = 13455; //m_dateQuality["20170906"] = 12677; //以上汇总完日起范围的结算信息,然后显示; PrintSeriesQuality(m_dateQuality); }