示例#1
0
文件: frmCpStat2.cs 项目: timsanc/HIS
        /// <summary>
        /// Stat
        /// </summary>
        void Stat()
        {
            string BeginDate = this.dteBegin.Value.ToString("yyyy-MM-dd");
            string EndDate   = this.dteEnd.Value.ToString("yyyy-MM-dd");

            if (Convert.ToDateTime(BeginDate + " 00:00:01") > Convert.ToDateTime(EndDate + " 00:00:01"))
            {
                MessageBox.Show("开始日期不能大于结束日期。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (txtPathName.Tag == null)
            {
                MessageBox.Show("请选择统计的路径。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataRow dr    = txtPathName.Tag as DataRow;
            string  d1    = this.dteBegin.Value.ToString("yyyy年MM月");
            string  d2    = this.dteEnd.Value.ToString("yyyy年MM月");
            string  title = string.Empty;       // "临床路径病例登记表";

            if (d1 == d2)
            {
                title = d1 + dr["cpname"].ToString() + "病例登记表";
            }
            else
            {
                title = d1 + "至" + d2 + dr["cpname"].ToString() + "病例登记表";
            }
            clsPublic.PlayAvi("findFILE.avi", "统计临床路径单病种统计报表,请稍候...");
            clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject();
            DataTable          dt  = svc.GetCpStat2(BeginDate, EndDate, Convert.ToInt32(dr["cpid"].ToString()));

            dwRep.SetRedrawOff();
            dwRep.Modify("t_title.text = '" + title + "'");
            dwRep.Retrieve(dt);
            if (dwRep.RowCount == 0)
            {
                dwRep.InsertRow(0);
            }
            dwRep.SetRedrawOn();
            clsPublic.CloseAvi();
            this.dwRep.Refresh();
        }