Esempio n. 1
0
 bool m_blnIsChange = false;        //判断工作组的资料是否有改动
 #region 构造函数
 public clsController_StatBaseInfo()
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     m_objManage = new clsDomainController_StatManage();
 }
Esempio n. 2
0
        public void m_mthQueryScienceStatInfo()
        {
            m_objViewer.m_lsvItemDetail.Items.Clear();
            #region checkValidate
            if (m_objViewer.m_txtAgeFrom.Text.ToString().Trim() != "")
            {
                if (!Microsoft.VisualBasic.Information.IsNumeric(m_objViewer.m_txtAgeFrom.Text.ToString().Trim()))
                {
                    MessageBox.Show("请输入正确年龄格式!", "学术统计");
                    m_objViewer.m_txtAgeFrom.Focus();
                    return;
                }
            }
            if (m_objViewer.m_txtAgeTo.Text.ToString().Trim() != "")
            {
                if (!Microsoft.VisualBasic.Information.IsNumeric(m_objViewer.m_txtAgeTo.Text.ToString().Trim()))
                {
                    MessageBox.Show("请输入正确年龄格式!", "学术统计");
                    m_objViewer.m_txtAgeTo.Focus();
                    return;
                }
            }
            if (m_objViewer.m_lsvItemList.Items.Count <= 0)
            {
                MessageBox.Show("请输入查询条件", "学术统计");
                return;
            }
            #endregion
            this.m_objViewer.m_btnQuery.Enabled = false;
            this.m_objViewer.Cursor             = System.Windows.Forms.Cursors.WaitCursor;
            #region InitalParameter
            string strCheckItemID  = m_objViewer.m_cboCheckItem.SelectedValue.ToString().Trim();
            string strCheckDatFrom = m_objViewer.m_dtpDatFrom.Value.ToShortDateString() + " 00:00:00";
            string strCheckDatTo   = m_objViewer.m_dtpDatTo.Value.ToShortDateString() + " 23:59:59";
            string strResultFrom   = m_objViewer.m_txtResultFrom.Text.ToString().Trim();
            string strResultTo     = m_objViewer.m_txtResultTo.Text.ToString().Trim();
            string strLowCompare   = m_objViewer.m_cboLowCompare.Text.ToString().Trim();
            if (strLowCompare == "在")
            {
                strLowCompare = "IN";
            }
            else if (strLowCompare == "不在")
            {
                strLowCompare = "NOT IN";
            }
            string strUpCompare = m_objViewer.m_cboUpCompare.Text.ToString().Trim();
            string strCondition = m_objViewer.m_cboCondition.Text.ToString().Trim();
            string strAgeFrom   = "";
            string strAgeTo     = "";
            string strSex       = m_objViewer.m_cboSex.Text.ToString().Trim();

            if (m_objViewer.m_txtAgeFrom.Text.ToString().Trim() != null && m_objViewer.m_txtAgeFrom.Text.ToString().Trim() != "")
            {
                strAgeFrom = m_objViewer.m_txtAgeFrom.Text.ToString().Trim() + " " + m_objViewer.m_cboFromAgeUnit.Text.ToString().Trim();
            }

            if (m_objViewer.m_txtAgeTo.Text.ToString().Trim() != null && m_objViewer.m_txtAgeTo.Text.ToString().Trim() != "")
            {
                strAgeTo = m_objViewer.m_txtAgeTo.Text.ToString().Trim() + " " + m_objViewer.m_cboToAgeUnit.Text.ToString().Trim();
            }
            #endregion

            clsLisScienceStatItemQueryCondition[] objVOArr = new clsLisScienceStatItemQueryCondition[m_objViewer.m_lsvItemList.Items.Count];
            for (int i = 0; i < m_objViewer.m_lsvItemList.Items.Count; i++)
            {
                objVOArr[i] = (clsLisScienceStatItemQueryCondition)m_objViewer.m_lsvItemList.Items[i].Tag;
            }

            clsDomainController_StatManage objManage = new clsDomainController_StatManage();
            DataTable dtbHead   = null;
            DataTable dtbDetail = null;
            DataSet   ds        = new DataSet();
            long      lngRes    = 0;
            lngRes = objManage.m_lngGetScienceStatByCondition(strCheckDatFrom, strCheckDatTo, strAgeFrom,
                                                              strAgeTo, strSex, objVOArr, out dtbHead, out dtbDetail);
            if (dtbHead != null && dtbDetail != null)
            {
                dtbHead.TableName   = "dtbHead";
                dtbDetail.TableName = "dtbDetail";
                ds.Tables.Add(dtbHead);
                ds.Tables.Add(dtbDetail);
            }
//			DataSet ds = m_mthCreateDataSet();

//			com.digitalwave.iCare.gui.LIS.Report.cryScienceStat obj = new com.digitalwave.iCare.gui.LIS.Report.cryScienceStat();

            CrystalDecisions.CrystalReports.Engine.ReportDocument objReportDoc = new ReportDocument();

            try
            {
                if (lngRes > 0 && ds != null)
                {
                    try
                    {
                        objReportDoc.Load(Application.StartupPath + "\\lis_reports\\cryScienceStat.rpt");
                        objReportDoc.SetDataSource(ds);
                    }
                    catch
                    {
                        MessageBox.Show("加载报表失败!");
                    }
                }
                else
                {
                    MessageBox.Show("没有符合条件的记录", "学术统计");
                    ds = null;
                    ds.Tables.Add(new DataTable("dtbHead"));
                    ds.Tables.Add(new DataTable("dtbDetail"));
                }

                #region  送参数
                try
                {
                    ////传送参数
                    //ParameterValues paramValues=new ParameterValues();
                    ////定义参数
                    //ParameterDiscreteValue discreteVal = new ParameterDiscreteValue();//
                    //discreteVal.Value=m_objViewer.m_dtpDatFrom.Value.ToShortDateString().Trim();
                    //paramValues.Add(discreteVal);
                    //ParameterDiscreteValue discreteVal1 = new ParameterDiscreteValue();//
                    //discreteVal1.Value=m_objViewer.m_dtpDatTo.Value.ToShortDateString().Trim();
                    //paramValues.Add(discreteVal1);

                    ////将参数加入集合
                    //discreteVal.Kind =DiscreteOrRangeKind.DiscreteValue;
                    //ParameterValues paramValue=new ParameterValues();

                    ////传送参数
                    //for(int i=0;i<=paramValues.Count-1;i++)
                    //{
                    //    paramValue.Clear();
                    //    paramValue.Add(paramValues[i]);
                    //    objReportDoc.DataDefinition.ParameterFields[i].ApplyCurrentValues(paramValue);
                    //}
                    objReportDoc.SetParameterValue(0, strCheckDatFrom.Substring(0, 16));
                    objReportDoc.SetParameterValue(1, strCheckDatTo.Substring(0, 16));
                }
                catch
                {
                }
                #endregion

                m_objViewer.m_ReportViewer.ReportSource = objReportDoc;
                //		m_objViewer.m_ReportViewer.RefreshReport();
            }
            catch
            {
            }
            finally
            {
                this.m_objViewer.Cursor             = System.Windows.Forms.Cursors.Default;
                this.m_objViewer.m_btnQuery.Enabled = true;
            }
        }