void GetDate(object sender, System.Timers.ElapsedEventArgs e) { int intHour = e.SignalTime.Hour; int intMinute = e.SignalTime.Minute; int intSecond = e.SignalTime.Second; // 定制时间; 比如 在10:30 :00 的时候执行某个函数 int iHour = 14; int iMinute = 17; int iSecond = 00; // 设置 每天的10:30:00开始执行程序 if (intHour == iHour && intMinute == iMinute && intSecond == iSecond) { txt_startDate.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); txt_endDate.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result = tloadhisRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); string _requesthis = tloadhisRequest.EndInvoke(result); string _request = tLoadwyRequest.EndInvoke(result2); // RefreshCheckData(_request, _requesthis); } }
protected void btnSearch_Click(object sender, EventArgs e) { DateTime t1 = Convert.ToDateTime(txt_startDate.Text.Trim()); DateTime t2 = Convert.ToDateTime(txt_endDate.Text.Trim()); DateTime t3 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); DateTime t5 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); string dateCompare = txt_startDate.Text.Trim() + " " + "11:00:00"; DateTime t4 = Convert.ToDateTime(dateCompare); if (DateTime.Compare(t1, t2) > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('开始时间大于结束时间啦!');</script>"); } if (DateTime.Compare(t4, t3) > 0) { //strErr += "截止日期必须在发布日期之后!"; //HttpContext.Current.Response.Write(" <script>alert('没有数据可导出!');"); // Response.Write(" <script>function window.onload() {alert( ' 弹出的消息' ); } </script> "); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('平台账单由于微信后台账单生成时间限制导致账单尚未生成,\\n 请于11点后查看!!');</script>"); } //else if (DateTime.Compare(t2, t5) <= 0) //{ // Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('时间选择有误,请重新选择!');</script>"); //} else { tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result = tloadhisRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); //string _requesthis = gethisReq(txt_startDate.Text.Trim(), txt_endDate.Text.Trim()); //List<string> _request = getReq(txt_startDate.Text.Trim(), txt_endDate.Text.Trim()); string _requesthis = tloadhisRequest.EndInvoke(result); List <string> _request = tLoadwyRequest.EndInvoke(result2); RefreshCheckData(_request, _requesthis); } }
protected void GridView_Count_RowCommand(object sender, GridViewCommandEventArgs e) { GridView.Visible = false; if (e.CommandName == "Check") { initJavascript(); int id = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView_Count.Rows[id]; string CheckDate = row.Cells[0].Text.ToString();//Convert.ToString(this.GridView_Count.Rows[id].Cells[0].ToString()); if (dt_wy != null && dt_his != null) { try { tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result = tloadhisRequest.BeginInvoke(CheckDate, CheckDate, null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(CheckDate, CheckDate, null, null); string _requesthis = tloadhisRequest.EndInvoke(result); string _request = tLoadwyRequest.EndInvoke(result2); tLoadHISData tloadhis = new tLoadHISData(gethisXml); IAsyncResult resulthis = tloadhis.BeginInvoke(_requesthis, null, null); tLoadWYData tloadwy = new tLoadWYData(getXml); IAsyncResult result_WY = tloadwy.BeginInvoke(_request, null, null); string strhisxml = tloadhis.EndInvoke(resulthis); string strxml = tloadwy.EndInvoke(result_WY); dt_his = GetDBdata.XmlToDataTable(strhisxml); dt_wy = GetDBdata.XmlToDataTable(strxml); this.GridView.DataSource = dt_wy.DefaultView; this.GridView.DataBind(); for (int i = dt_his.Rows.Count - 1; i >= 0; i--) { for (int k = 0; k < dt_wy.Rows.Count; k++) { if (dt_his.Rows[i][3].ToString() == dt_wy.Rows[k][11].ToString() && dt_his.Rows[i][13].ToString() == dt_wy.Rows[k][1].ToString() && dt_his.Rows[i][1].ToString() == dt_wy.Rows[k][2].ToString()) { GridView.Rows[k].BackColor = System.Drawing.Color.Green; } } } DetailsListTitle.Visible = true; DetailsListTitle.Text = CheckDate + "的明细单。 备注:绿色是匹配成功的订单,白色是HIS没有的订单"; } catch (Exception ex) { Logging.WriteBuglog(ex); } finally { this.GridView.Visible = true; } } else { //this.GridView.Visible = true; } } }
/// <summary> /// 刷新数据明细数据 /// </summary> public void RefreshCheckData() { #region 查询明细数据 //initJavascript(); tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result_his = tloadhisRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); string _requesthis = tloadhisRequest.EndInvoke(result_his); string _request = tLoadwyRequest.EndInvoke(result2); tLoadHISData tloadhis = new tLoadHISData(gethisXml); IAsyncResult result = tloadhis.BeginInvoke(_requesthis, null, null); tLoadWYData tloadwy = new tLoadWYData(getXml); IAsyncResult result_WY = tloadwy.BeginInvoke(_request, null, null); string strhisxml = tloadhis.EndInvoke(result); string strxml = tloadwy.EndInvoke(result_WY); dt_his = GetDBdata.XmlToDataTable(strhisxml); dt_wy = GetDBdata.XmlToDataTable(strxml); if (dt_wy != null && dt_his != null) { try { //this.GridView.DataSource = dt_wy.DefaultView; //this.GridView.DataBind(); //for (int i = dt_his.Rows.Count-1;i>=0; i--) //{ // for (int k =0; k < dt_wy.Rows.Count; k++) // { // if (dt_his.Rows[i][3].ToString() == dt_wy.Rows[k][11].ToString() && dt_his.Rows[i][13].ToString() == dt_wy.Rows[k][1].ToString() && dt_his.Rows[i][1].ToString() == dt_wy.Rows[k][2].ToString()) // { // GridView.Rows[k].BackColor = System.Drawing.Color.Green; // } // } //} #region 统计所有数据 dt_his_Result = GetDBdata.GetResult(dt_his); dt_wy_Result = GetDBdata.GetResult(dt_wy); DtAll = GetDBdata.UniteDataTable(dt_his_Result, dt_wy_Result, "合并Dt"); DtAll.Columns.AddRange(new DataColumn[] { new DataColumn("different", typeof(double)) }); DataRow drw = DtAll.NewRow(); double different_money = 0.00; for (int i = 0; i < DtAll.Rows.Count; i++) { foreach (DataRow dr in DtAll.Rows) { different_money = different_money + (Convert.ToDouble(DtAll.Rows[i]["Amounthis"]) - Convert.ToDouble(DtAll.Rows[i]["wxAmount"])); DtAll.Rows[i]["different"] = different_money.ToString("f2"); different_money = 0; } } this.GridView.Visible = false; this.GridView_Count.DataSource = DtAll.DefaultView; this.GridView_Count.DataBind(); #endregion #region 账不平的变红色 for (int k = 0; k < DtAll.Rows.Count; k++) { if (DtAll.Rows[k][6].ToString() != "0") { GridView_Count.Rows[k].BackColor = System.Drawing.Color.Red; //Logging.WriteHISlog("记录日志:","HIS的CARD_NO="+dt_his.Rows[i][3].ToString()+ "\r\n"+"微医的HOSP_PATIENT_ID="+ dt_wy.Rows[k][11].ToString() + "\r\n" + "HIS的TRANS_NO="+dt_his.Rows[i][13].ToString()+"微医的HOSP_ORDER_ID = "+ dt_wy.Rows[k][1].ToString() + "\r\n" + "HIS的TRANS_TYPE=" + dt_his.Rows[i][1].ToString() + "\r\n" + "微医的ORDER_TYPE=" + dt_wy.Rows[k][2].ToString() + ""); } } #endregion } catch (Exception Exc) { Logging.WriteBuglog(Exc); } finally { Logging.WriteWYlog(txt_startDate.Text + "至" + txt_endDate.Text + "的日志", strxml); Logging.WriteHISlog(txt_startDate.Text + "至" + txt_endDate.Text + "的日志", strhisxml); } } else { this.GridView.DataSource = ""; this.GridView.DataBind(); } #endregion }