Ejemplo n.º 1
0
        /// <summary>
        /// 查询数据
        /// </summary>
        private void QueryData(string wherestr)
        {
            string    str = @"SELECT
                                                ' ' 序号,
                                                mg.blh,
                                                yb.brxm,
                                                (
                                                CASE
                                                    WHEN yb.xb = 1 THEN '男'
                                                    WHEN yb.xb = 2 THEN '女'
                                                    ELSE '未知'
                                                END
                                                ) xb,
                                                yb.csrq,
                                                mm.jzrq ,
                                                mj.JSSJ,
                                                dbo.fun_getDeptname(mj.JSKSDM) ksname,
                                                mj.JSKSDM,
                                                dbo.fun_getEmpName(mj.JSYSDM) ysname,
                                                mj.JSYSDM,
                                                mm.lxdh,
                                                mm.xzdz,
                                                (SELECT yk.KH FROM YY_KDJB AS yk WHERE mg.KDJID = yk.KDJID) kahao,
                                                  (select  NAME   from JC_OCCUPATI where CODE =mm.zy) as zy,               
                                                mg.GHSJ,
                                                 mm.jzxm ,            
                                                    CASE WHEN mm.tiwen = 0 THEN NULL ELSE mm.tiwen END tiwen,         
                                                    CASE WHEN mm.xueya = 0 THEN NULL ELSE mm.xueya END xueya,      
                                                    CASE WHEN mm.maibo = 0 THEN NULL ELSE mm.maibo END maibo,          
                                                                 mm.yxjb ,  
                                                                        (  CASE
                                                    WHEN mm.fenji = 1 THEN '1级'
                                                    WHEN mm.fenji = 2 THEN '2级'
                                                   WHEN mm.fenji = 3 THEN '3级'
                                                END )           
                                                                fenji  ,          
                                                             mm. fbrq ,             
                                                              mm.zdsj ,             
                                                               mm.lxbxjcs, 
                                                               (  CASE
                                                    WHEN mm.cfz = 0 THEN '初诊'
                                                    WHEN mm.cfz = 1 THEN '复诊'
                                                   
                                                END )cfz,               
                                                           mm.crbyq ,           
                                                                         mm.bgr ,              
                                                                    CASE WHEN mm.xinlv = 0 THEN NULL ELSE mm.xinlv END xinlv,            
                                                                      CASE WHEN mm.huxi = 0 THEN NULL ELSE mm.huxi END huxi,             
                                                                      CASE WHEN mm.ssy = 0 THEN NULL ELSE mm.ssy END ssy,           
                                                                  mm.yishi ,   
                                                                  CASE WHEN mm.MEWSdf = 0 THEN NULL ELSE mm.MEWSdf END MEWSdf,        
                                                                           CASE WHEN mm.ksxt = 0 THEN NULL ELSE mm.ksxt END ksxt,            
                                                                          mm.xybhd ,            
                                                              
                                                                   mm.brqx ,   
                                                              
                                                                  mm.fenqu,             
                                                                   mm.zhusu ,     
                                                                         mm.shenzhi ,        
                                                           ryfs ,
                                                           mg.ZDMC,
                                                                      
                                                               (  CASE
                                                    WHEN mm.sffr= 0 THEN '否'
                                                    WHEN mm.sffr = 1 THEN '是'
                                                   
                                                END )                     
                                                        sffr  
                                                      
                                                   FROM MZYS_JZJL mj
                                            INNER JOIN dbo.VI_YY_BRXX yb
                                                ON mj.BRXXID = yb.BRXXID
                                            INNER JOIN dbo.VI_MZ_GHXX mg
                                                ON mj.GHXXID = mg.GHXXID
                                                AND mj.BJSBZ = 1
                                            LEFT JOIN MZ_MZRZ mm
                                                ON mg.blh = mm.blh 
                                            where 1=1  ";
            DataTable dt  = new DataTable();

            dt = DbOpt.GetDataTable(str + wherestr);
            Fun.AddRowtNo(dt);
            dgvList.DataSource = dt;
        }
Ejemplo n.º 2
0
        private void GetData()
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[3];


                parameters[0].Text  = "@rq1";
                parameters[0].Value = dtpBjksj.Value.ToString();

                parameters[1].Text  = "@rq2";
                parameters[1].Value = dtpEjksj.Value.ToString();

                parameters[2].Text  = "@DocId";
                parameters[2].Value = TrasenFrame.Forms.FrmMdiMain.CurrentUser.EmployeeId;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_ReportBuessinessQuerybyDoc", parameters, dset, "sfmx", 60);


                Fun.AddRowtNo(dset.Tables[0]);
                DataTable dt = dset.Tables[0];
                dt.Columns.Add("药品总额", typeof(decimal));
                dt.Columns.Add("药品比例", typeof(decimal));
                dt.Columns.Add("西药比例", typeof(decimal));
                dt.Columns.Add("自制药比例", typeof(decimal));
                dt.Columns.Add("中成药比例", typeof(decimal));
                dt.Columns.Add("中草药比例", typeof(decimal));
                dt.Columns.Add("膏方比例", typeof(decimal));
                dt.Columns.Add("其他药品比例", typeof(decimal));
                if (dt.Rows.Count <= 1)
                {
                    dt.Rows[0]["药品总额"]   = 0;
                    dt.Rows[0]["药品比例"]   = 0;
                    dt.Rows[0]["西药比例"]   = 0;
                    dt.Rows[0]["自制药比例"]  = 0;
                    dt.Rows[0]["中成药比例"]  = 0;
                    dt.Rows[0]["中草药比例"]  = 0;
                    dt.Rows[0]["膏方比例"]   = 0;
                    dt.Rows[0]["其他药品比例"] = 0;
                }
                else
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        decimal num = 0;
                        dt.Rows[i]["药品总额"] = Decimal.Parse(dt.Rows[i]["西药"].ToString()) +
                                             Decimal.Parse(dt.Rows[i]["自制药"].ToString()) +
                                             Decimal.Parse(dt.Rows[i]["中成药"].ToString()) +
                                             Decimal.Parse(dt.Rows[i]["中草药"].ToString()) +
                                             Decimal.Parse(dt.Rows[i]["膏方"].ToString()) +
                                             Decimal.Parse(dt.Rows[i]["其他药品"].ToString());
                        decimal total = Decimal.Parse(dt.Rows[i]["合计"].ToString());
                        if (total != 0)
                        {
                            num = Decimal.Parse(dt.Rows[i]["药品总额"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["药品比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["西药"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["西药比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["自制药"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["自制药比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["中成药"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["中成药比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["中草药"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["中草药比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["膏方"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["膏方比例"] = num.ToString("f2");

                            num = Decimal.Parse(dt.Rows[i]["其他药品"].ToString()) / Decimal.Parse(dt.Rows[i]["合计"].ToString()) * 100;
                            dt.Rows[i]["其他药品比例"] = num.ToString("f2");
                        }
                        else
                        {
                            dt.Rows[i]["药品比例"]   = 0;
                            dt.Rows[i]["西药比例"]   = 0;
                            dt.Rows[i]["自制药比例"]  = 0;
                            dt.Rows[i]["中成药比例"]  = 0;
                            dt.Rows[i]["中草药比例"]  = 0;
                            dt.Rows[i]["膏方比例"]   = 0;
                            dt.Rows[i]["其他药品比例"] = 0;
                        }
                    }
                }
                int col = 4;
                dt.Columns["药品总额"].SetOrdinal(col); ++col;
                dt.Columns["药品比例"].SetOrdinal(col); ++col;
                dt.Columns["西药"].SetOrdinal(col); ++col;
                dt.Columns["西药比例"].SetOrdinal(col); ++col;
                dt.Columns["自制药"].SetOrdinal(col); ++col;
                dt.Columns["自制药比例"].SetOrdinal(col); ++col;
                dt.Columns["中成药"].SetOrdinal(col); ++col;
                dt.Columns["中成药比例"].SetOrdinal(col); ++col;
                dt.Columns["中草药"].SetOrdinal(col); ++col;
                dt.Columns["中草药比例"].SetOrdinal(col); ++col;
                dt.Columns["膏方"].SetOrdinal(col); ++col;
                dt.Columns["膏方比例"].SetOrdinal(col); ++col;
                dt.Columns["其他药品"].SetOrdinal(col); ++col;
                dt.Columns["其他药品比例"].SetOrdinal(col); ++col;

                this.dataGridView1.DataSource = dt;
                for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                {
                    this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm" || this.dataGridView1.Columns[i].Name.ToLower() == "sort")
                    {
                        this.dataGridView1.Columns[i].Visible = false;
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 统计数据
        /// </summary>
        private void SelectData()
        {
            try
            {
                string where_date = "";
                if (chksfrq.Checked)
                {
                    where_date = TjMeans.GetDateWhere("a.sfrq", this.list_datewhere);
                }
                else
                {
                    where_date = TjMeans.GetDateWhere("qrsj", this.list_datewhere);
                }
                int _isview = 0;
                if (this.isview)
                {
                    _isview = 1;
                }

                ParameterEx[] parameters = new ParameterEx[7];
                parameters[0].Text  = "@isview";
                parameters[0].Value = _isview;//chksfrq.Checked == true ? dtp1.Value.ToString() : "";

                parameters[1].Text  = "@datewhere";
                parameters[1].Value = where_date;//chksfrq.Checked == true ? dtp2.Value.ToString() : "";

                parameters[2].Text  = "@type";
                parameters[2].Value = rdJg.Checked == true ? 0 : 1;

                int _jsfs = 0;
                if (rbYb.Checked)
                {
                    _jsfs = 1;
                }
                else if (rbZf.Checked)
                {
                    _jsfs = 2;
                }
                else
                {
                    _jsfs = 0;
                }

                parameters[3].Text  = "@jsfs";
                parameters[3].Value = _jsfs;

                parameters[4].Text  = "@jgbm";
                parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                parameters[5].Text  = "@include_kdks";
                parameters[5].Value = checkBox2.Checked == true ? 0 : 1;

                //parameters[6].Text = "@qsfrq1";
                //parameters[6].Value = chkqfrq.Checked == true ? where_date : "";//chkqfrq.Checked == true ? dtpqrrq1.Value.ToString() : "";

                //parameters[7].Text = "@qsfrq2";
                //parameters[7].Value = chkqfrq.Checked == true ? dtpqrrq2.Value.ToString() : "";

                parameters[6].Text  = "@zxksdm";
                parameters[6].Value = Convertor.IsNull(txtzxks.Tag, "0").ToString();

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_ZxkssrtjByDate", parameters, dset, "sfmx", 30);
                Fun.AddRowtNo(dset.Tables[0]);


                this.dataGridView1.DataSource = dset.Tables[0];
            }
            catch (Exception ea)
            {
                MessageBox.Show("出现异常!原因:" + ea.Message, "提示");
            }
        }
Ejemplo n.º 4
0
        private void GetDataMx(string docName, string srks, string kdksName)
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[6];

                int ii = 0;
                parameters[ii].Text  = "@rq1";
                parameters[ii].Value = dtpBjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@rq2";
                parameters[ii].Value = dtpEjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@DeptID";
                parameters[ii].Value = TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId;
                ++ii;

                parameters[ii].Text  = "@docName";
                parameters[ii].Value = docName;
                ++ii;

                parameters[ii].Text  = "@srksName";
                parameters[ii].Value = srks;
                ++ii;

                parameters[ii].Text  = "@kdksName";
                parameters[ii].Value = kdksName;
                ++ii;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_ReportBuessinessQuerybyDept_MX", parameters, dset, "sfmx", 90);


                Fun.AddRowtNo(dset.Tables[0]);
                DataTable dt = dset.Tables[0];

                //int col = 3;
                //dt.Columns["药品总额"].SetOrdinal(col); ++col;

                //dt.Columns["西药"].SetOrdinal(col); ++col;

                //dt.Columns["自制药"].SetOrdinal(col); ++col;

                //dt.Columns["中成药"].SetOrdinal(col); ++col;

                //dt.Columns["中草药"].SetOrdinal(col); ++col;

                //dt.Columns["膏方"].SetOrdinal(col); ++col;

                //dt.Columns["其他药品"].SetOrdinal(col); ++col;

                this.dataGridView2.Columns.Clear();
                this.dataGridView2.DataSource = dt;
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 5
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                if (chkbkrq.Checked == false &&
                    chkye.Checked == false && chkdj.Checked == false && chkgs.Checked == false &&
                    txtjtdz.Text.Trim() == "" && txtgzdw.Text.Trim() == ""
                    )
                {
                    MessageBox.Show("检索的范围太大,请选择条件", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                ParameterEx[] parameters = new ParameterEx[21];

                parameters[0].Text  = "@klx";
                parameters[0].Value = 0;

                parameters[1].Text  = "@kh";
                parameters[1].Value = "";

                parameters[2].Text  = "@brxm";
                parameters[2].Value = "";

                parameters[3].Text  = "@BRLXFS";
                parameters[3].Value = "";

                parameters[4].Text  = "@BRLX";
                parameters[4].Value = 0;;

                parameters[5].Text  = "@gj";
                parameters[5].Value = "";

                parameters[6].Text  = "@mz";
                parameters[6].Value = "";

                parameters[7].Text  = "@sfzh";
                parameters[7].Value = "";

                parameters[8].Text  = "@cblx";
                parameters[8].Value = 0;

                parameters[9].Text  = "@zy";
                parameters[9].Value = "";

                parameters[10].Text  = "@csdz";
                parameters[10].Value = "";

                parameters[11].Text  = "@jtdz";
                parameters[11].Value = txtjtdz.Text.Trim();

                parameters[12].Text  = "@gzdw";
                parameters[12].Value = txtgzdw.Text.Trim();

                parameters[13].Text  = "@DJSJ1";
                parameters[13].Value = chkbkrq.Checked == true?dtpjsrq1.Value.ToString() : "";

                parameters[14].Text  = "@DJSJ2";
                parameters[14].Value = chkbkrq.Checked == true?dtpjsrq2.Value.ToString() : "";

                parameters[15].Text  = "@CSRQ1";
                parameters[15].Value = "";

                parameters[16].Text  = "@CSRQ2";
                parameters[16].Value = "";

                parameters[17].Text  = "@djy";
                parameters[17].Value = 0;

                parameters[18].Text  = "@BYE";
                parameters[18].Value = chkye.Checked == true ? 1 : 0;

                parameters[19].Text  = "@BDJ";
                parameters[19].Value = chkdj.Checked == true ? 1 : 0;

                parameters[20].Text  = "@BGS";
                parameters[20].Value = chkgs.Checked == true ? 1 : 0;

                dset = new DataSet();
                InstanceForm.BDatabase.AdapterFillDataSet("SP_MZSF_CX_BRXX_JCQK", parameters, dset, "sfmx", 30);

                Fun.AddRowtNo(dset.Tables[0]);
                this.dataGridView1.DataSource = dset.Tables[0];

                lblbkzs.Text = dset.Tables[0].Rows.Count.ToString();
                lblljcr.Text = dset.Tables[0].Compute("sum(累计存入)", "").ToString();
                lblljxf.Text = dset.Tables[0].Compute("sum(累计消费)", "").ToString();
                lbljcje.Text = dset.Tables[0].Compute("sum(卡余额)", "").ToString();
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 6
0
        private void GetData()
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[10];
                int           ii         = 0;



                parameters[ii].Text  = "@rq1";
                parameters[ii].Value = dtpBjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@rq2";
                parameters[ii].Value = dtpEjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@userName";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@dept";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@inpatientType";
                parameters[ii].Value = comboBox1.Text;
                ++ii;

                parameters[ii].Text  = "@ChargeType";
                parameters[ii].Value = 0;
                ++ii;

                parameters[ii].Text  = "@BillNo";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@LackNo";
                parameters[ii].Value = Decimal.Parse(textBox3.Text == ""?"0":textBox3.Text);
                ++ii;

                parameters[ii].Text  = "@zyh";
                parameters[ii].Value = textBox1.Text;
                ++ii;

                parameters[ii].Text  = "@ReportType";
                parameters[ii].Value = 0;
                ++ii;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("dbo_zy_LackDisChargeReport", parameters, dset, "sfmx", 60);


                Fun.AddRowtNo(dset.Tables[0]);
                DataTable dt = dset.Tables[0];

                this.dataGridView1.Columns.Clear();
                this.dataGridView1.DataSource = dt;
                for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                {
                    this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm" || this.dataGridView1.Columns[i].Name.ToLower() == "sort")
                    {
                        this.dataGridView1.Columns[i].Visible = false;
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 7
0
        private void butcx_Click(object sender, EventArgs e)
        {
            if (txtkh.Text.Trim() == "" && txtxm.Text.Trim() == "" && chkcsrq.Checked == false &&
                txtjtdh.Text.Trim() == "" && txtjtdz.Text.Trim() == "" && txtsfzh.Text.Trim() == "" && txtgrlxfs.Text.Trim() == "" &&
                dtpDjsj1.Checked == false && dtpDjsj2.Checked == false && txtzyh.Text.Trim() == "")
            {
                MessageBox.Show("查询范围过大,至少需要输入一个查询条件", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            try
            {
                ParameterEx[] parameters = new ParameterEx[12];

                parameters[0].Text  = "@klx";
                parameters[0].Value = Convert.ToInt32(Convertor.IsNull(cmbklx.SelectedValue, "0"));

                parameters[1].Text  = "@kh";
                parameters[1].Value = txtkh.Text.Trim();

                parameters[2].Text  = "@brxm";
                parameters[2].Value = txtxm.Text.Trim();

                parameters[3].Text  = "@BRLXFS";
                parameters[3].Value = txtgrlxfs.Text.Trim();

                parameters[4].Text  = "@jtdz";
                parameters[4].Value = txtjtdz.Text.Trim();

                parameters[5].Text  = "@jtdh";
                parameters[5].Value = txtjtdh.Text.Trim();

                parameters[6].Text  = "@CSRQ";
                parameters[6].Value = chkcsrq.Checked == true?dtpcsrq.Value.ToShortDateString() : "";

                parameters[7].Text  = "@sfzh";
                parameters[7].Value = txtsfzh.Text.Trim();

                int zt = 0;
                if (rdDJ.Checked)
                {
                    zt = 1;
                }
                if (rdGS.Checked)
                {
                    zt = 2;
                }
                if (rdozf.Checked)
                {
                    zt = 9;
                }
                parameters[8].Text  = "@zt";
                parameters[8].Value = zt;

                parameters[9].Text  = "@bdjsj";
                parameters[9].Value = dtpDjsj1.Checked == true?dtpDjsj1.Value.ToString("yyyy-MM-dd") + " 00:00:00" : "";

                parameters[10].Text  = "@edjsj";
                parameters[10].Value = dtpDjsj2.Checked == true?dtpDjsj2.Value.ToString("yyyy-MM-dd") + " 23:59:59" : "";

                parameters[11].Text  = "@zyh";
                parameters[11].Value = txtzyh.Text.Trim();

                DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_MZSF_CX_JKHK", parameters, 30);

                Fun.AddRowtNo(tb);
                this.dataGridView2.DataSource = tb;

                GetJhkJl(Guid.Empty);
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 8
0
        private void DsetSelect(int xmly, int zyyf, int execdeptid, string ss)
        {
            string filter = "";

            filter = filter.Replace("%", "[%]");
            filter = filter.Replace("'", "''");
            filter = filter.Replace("[", "[[]");
            filter = filter + "  项目id>0 ";
            if (rdomh.Checked == true)
            {
                ss = "%" + ss;
            }
            if (rdopy.Checked == true)
            {
                filter = filter + " and (拼音码 LIKE '" + ss + "%') ";
            }
            if (rdowb.Checked == true)
            {
                filter = filter + " and (五笔码 LIKE '" + ss + "%') ";
            }
            if (rdomc.Checked == true)
            {
                filter = filter + " and (项目内容 LIKE '%" + ss + "%') ";
            }
            if (_tjdxm != "" && _tjdxm == "03") //如果是新开处方并且是中药处方的话只能开中草药
            {
                filter = filter + " and statitem_code='03' ";
            }
            else if (_tjdxm == "02") //如果是成药处方就不能开中草药
            {
                filter = filter + " and statitem_code<>'03'";
            }
            else if (new SystemCfg(3047).Config == "1" && _tjdxm == "01")//Add By Zj 2012-12-26 中药与西药不能开在一张处方上
            {
                filter = filter + " and statitem_code<>'03'";
            }
            else
            {
                filter = filter + "";
            }

            if ((execdeptid > 0 && xmly == 1) || (execdeptid > 0 && cfg_ff.Config == "0"))
            {
                filter = filter + " and zxksid = " + execdeptid + " ";
            }
            if (xmly != 0)
            {
                filter = filter + " and 项目来源 = " + xmly + " ";
            }
            if (zyyf == 1)
            {
                filter = filter + " and ( ( kslx2 = '住院药房'or kslx2 ='病室药房' ) or 项目来源=2)";
            }
            else
            {
                filter = filter + " and ( kslx2 <> '住院药房' or kslx2 <> '病室药房' )";
            }

            DataRow[] drs = Dset.Tables["ITEM"].Select(filter, " bmcd ASC");

            for (int i = 0; i < Dset.Tables["ITEM"].Columns.Count; i++)
            {
                Console.WriteLine(Dset.Tables["ITEM"].Columns[i].ColumnName);
                Console.WriteLine(Dset.Tables["ITEM"].Columns[i].Caption);
            }

            DataTable tb  = (DataTable)dataGridView1.DataSource;
            DataTable tab = tb.Clone();

            DataRow[] row_bl = null;
            for (int i = 0; i <= drs.Length - 1; i++)
            {
                if (_issfy && drs[i]["项目来源"].ToString() == "1")
                {
                    continue;
                }
                //Add By zp 2014-01-10
                if (_lgzdyfid > 0 && drs[i]["项目来源"].ToString() == "1")
                {
                    if (_lgzdyfid != Convert.ToInt32(drs[i]["zxksid"]))
                    {
                        continue;
                    }
                }
                //找医保比例
                string ssss = "";
                if (drs[i]["项目来源"].ToString() == "1")
                {
                    ssss = " xmid=" + drs[i]["ggid"] + "  and yblx=" + yblx.ToString() + " and xmly=" + drs[i]["项目来源"] + "";
                }
                else
                {
                    ssss = " xmid=" + drs[i]["项目id"] + "  and yblx=" + yblx.ToString() + " and xmly=" + drs[i]["项目来源"] + "";
                }
                row_bl = Dset.Tables["ZFBL"].Select(ssss, "");
                if (row_bl.Length > 0)
                {
                    try
                    {
                        drs[i]["医保比例"] = Convertor.IsNull(row_bl[0]["zfbl"], "") == "" ? "" : Convert.ToString(Convert.ToDouble(row_bl[0]["zfbl"]) * 100) + "%";
                    }
                    catch
                    {
                        drs[i]["医保比例"] = Convertor.IsNull(row_bl[0]["zfbl"], "") == "" ? "0" : Convert.ToString(Convert.ToDouble(row_bl[0]["zfbl"]) * 100) + "%";
                    }
                }
                else
                {
                    if (_issfy)
                    {
                        drs[i]["医保比例"] = "0";
                    }
                    else
                    {
                        drs[i]["医保比例"] = ""; //护士留观划价 模板的dt该列为decimal类型
                    }
                }
                drs[i]["序号"] = Convert.ToString(i + 1);
                tab.ImportRow(drs[i]);
                if (_issfy)
                {
                    tab.Rows[tab.Rows.Count - 1]["项目内容"] = drs[i]["项目名称"];
                }
            }
            Fun.AddRowtNo(tab); //Add by CC
            dataGridView1.DataSource = tab;
        }
Ejemplo n.º 9
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[9];
                parameters[0].Text  = "@rq1";
                parameters[0].Value = chksfrq.Checked == true?dtp1.Value.ToString() : "";

                parameters[1].Text  = "@rq2";
                parameters[1].Value = chksfrq.Checked == true?dtp2.Value.ToString() : "";

                parameters[2].Text  = "@type";
                parameters[2].Value = rdJg.Checked == true ? 0 : 1;

                int _jsfs = 0;
                if (rbYb.Checked)
                {
                    _jsfs = 1;
                }
                else if (rbZf.Checked)
                {
                    _jsfs = 2;
                }
                else
                {
                    _jsfs = 0;
                }

                parameters[3].Text  = "@jsfs";
                parameters[3].Value = _jsfs;

                parameters[4].Text  = "@jgbm";
                parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                parameters[5].Text  = "@include_kdks";
                parameters[5].Value = checkBox2.Checked == true ? 0 : 1;

                parameters[6].Text  = "@qsfrq1";
                parameters[6].Value = chkqfrq.Checked == true?dtpqrrq1.Value.ToString() : "";

                parameters[7].Text  = "@qsfrq2";
                parameters[7].Value = chkqfrq.Checked == true?dtpqrrq2.Value.ToString() : "";

                parameters[8].Text  = "@zxksdm";
                parameters[8].Value = Convertor.IsNull(txtzxks.Tag, "0").ToString();

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_Zxkssrtj", parameters, dset, "sfmx", 30);
                Fun.AddRowtNo(dset.Tables[0]);

                //if (this.dataGridView1.ColumnCount > 4)
                //{
                //    this.dataGridView1.Columns[0].Frozen = false;
                //    this.dataGridView1.Columns[1].Frozen = false;
                //    this.dataGridView1.Columns[2].Frozen = false;
                //    this.dataGridView1.Columns[3].Frozen = false;
                //}
                // 添加冻结功能 by fangke
                dataGridView1.Columns.Clear();
                this.dataGridView1.DataSource        = dset.Tables[0];
                this.dataGridView1.Columns[0].Frozen = true;
                this.dataGridView1.Columns[1].Frozen = true;
                this.dataGridView1.Columns[2].Frozen = true;
                this.dataGridView1.Columns[3].Frozen = true;
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnSelect_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            try
            {
                this.Cursor       = PubStaticFun.WaitCursor();
                btnSelect.Enabled = false;

                int tjlx = 0;
                if (rdoks.Checked == true)
                {
                    tjlx = 1;
                }
                if (rdoys.Checked == true)
                {
                    tjlx = 2;
                }
                ParameterEx[] parameters = new ParameterEx[5];
                parameters[0].Value = dtp1.Value.ToShortDateString() + "";
                parameters[1].Value = dtp2.Value.ToShortDateString() + "";
                parameters[2].Value = tjlx;
                parameters[3].Value = Convertor.IsNull(txtks.Tag, "0");
                parameters[4].Value = Convertor.IsNull(txtys.Tag, "0");


                parameters[0].Text = "@rq1";
                parameters[1].Text = "@rq2";
                parameters[2].Text = "@tjlx";
                parameters[3].Text = "@ksdm";
                parameters[4].Text = "@ysdm";


                DataSet dset = new DataSet();
                InstanceForm.BDatabase.AdapterFillDataSet("SP_YP_KSSZB_ZYDDD", parameters, dset, "kss", 30);

                dset.Tables[0].TableName      = "Tb";
                this.dataGridView1.DataSource = dset.Tables[0];

                Fun.AddRowtNo(dset.Tables[0]);

                DataRow rows = null;
                if (rdoyp.Checked == true && dset.Tables[1].Rows.Count > 0)
                {
                    rows = dset.Tables[1].Rows[0];
                }
                if (rdoks.Checked == true && dset.Tables[0].Rows.Count > 0)
                {
                    rows = dset.Tables[0].Rows[dset.Tables[0].Rows.Count - 1];
                }
                if (rdoys.Checked == true && dset.Tables[0].Rows.Count > 0)
                {
                    rows = dset.Tables[0].Rows[dset.Tables[0].Rows.Count - 1];
                }

                txtDDD.Text           = rows["累计DDD数"].ToString();
                txtoutPatient.Text    = rows["总出院人数"].ToString();
                txtAvgOutpatient.Text = rows["平均住院天数"].ToString();
                txtpatientCount.Text  = rows["同期收治患者人天数"].ToString();
                txtqiangdu.Text       = rows["抗菌药物使用强度"].ToString();
                txtkjywrc.Text        = rows["使用抗菌药物出院总人数"].ToString();
                txtksssyl.Text        = rows["抗菌药物使用率"].ToString();

                btnSelect.Enabled = true;
            }
            catch (System.Exception err)
            {
                btnSelect.Enabled = true;
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }
Ejemplo n.º 11
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                //Modify By Zj 2012-12-28 增加统计口径
                ParameterEx[] parameters = new ParameterEx[4];
                parameters[0].Text  = "@rq1";
                parameters[0].Value = dtp1.Value.ToString();

                parameters[1].Text  = "@rq2";
                parameters[1].Value = dtp2.Value.ToString();

                parameters[2].Text  = "@jgbm";
                parameters[2].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                parameters[3].Text  = "@tjlx";
                parameters[3].Value = radioButton1.Checked ? 0 : 1;
                if (TrasenFrame.Classes.Constant.HospitalName == "邵阳市第一人民医院")
                {
                    parameters[3].Value = checkBox2.Checked ? 1 : 0;//Modify by zouchihua 2013-5-22 邵阳这里是区分合并还是不合并
                }

                dset = new DataSet();
                //add by zouchihua 2013-4-2 增加医保人次统计
                if (CHbYb.Checked == false)
                {
                    TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_gh_ghrctj", parameters, dset, "sfmx", 30);
                }
                else
                {
                    TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_gh_ghrctj_YBLX", parameters, dset, "sfmx", 30);
                }
                //DataTable tb = TrasenFrame.Forms.FrmMdiMain.Database.GetDataTable("SP_MZSF_TJ_gh_ghrctj", parameters, 30);

                for (int i = 0; i <= dset.Tables[2].Columns.Count - 1; i++)
                {
                    DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
                    col.HeaderText       = dset.Tables[2].Columns[i].ColumnName != "急诊小计" ? dset.Tables[2].Columns[i].ColumnName.Replace("急诊", "") : dset.Tables[2].Columns[i].ColumnName;
                    col.DataPropertyName = dset.Tables[2].Columns[i].ColumnName;
                    col.Name             = dset.Tables[2].Columns[i].ColumnName;
                    switch (col.Name)
                    {
                    case "序号":
                        col.Width = 40;
                        break;

                    case "科室":
                        col.Width = 100;
                        break;

                    default:
                        col.Width = 50;
                        break;
                    }

                    if (dataGridView1.Columns.Contains(dset.Tables[2].Columns[i].ColumnName) == false)
                    {
                        dataGridView1.Columns.Add(col);
                    }
                }
                Fun.AddRowtNo(dset.Tables[2]);
                this.dataGridView1.DataSource = dset.Tables[2];

                //for (int i = 0; i <= tb.Columns.Count - 1; i++)
                //{
                //    DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
                //    col.HeaderText = tb.Columns[i].ColumnName.Replace("急诊", "");
                //    col.DataPropertyName = tb.Columns[i].ColumnName;
                //    col.Name = tb.Columns[i].ColumnName;
                //    if (dataGridView1.Columns.Contains(tb.Columns[i].ColumnName) == false)
                //        dataGridView1.Columns.Add(col);
                //}


                //Fun.AddRowtNo(tb);
                //this.dataGridView1.DataSource =tb;
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 12
0
        private void butcx_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtkh.Text.Trim() == "" && txtbrxm.Text.Trim() == "" &&
                    txtbrlxfs.Text.Trim() == "" && txtsfzh.Text.Trim() == "" && txtcsdz.Text.Trim() == "" &&
                    txtjtdz.Text.Trim() == "" && txtgzdw.Text.Trim() == "" && chkcsrq.Checked == false &&
                    chkdjsj.Checked == false)
                {
                    MessageBox.Show("检索的范围太大,请选择条件", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                ParameterEx[] parameters = new ParameterEx[18];

                parameters[0].Text  = "@klx";
                parameters[0].Value = Convert.ToInt32(Convertor.IsNull(cmbklx.SelectedValue, "0"));

                parameters[1].Text  = "@kh";
                parameters[1].Value = txtkh.Text.Trim();

                parameters[2].Text  = "@brxm";
                parameters[2].Value = txtbrxm.Text.Trim();

                parameters[3].Text  = "@BRLXFS";
                parameters[3].Value = txtbrlxfs.Text.Trim();

                parameters[4].Text  = "@BRLX";
                parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbbrlx.SelectedValue, "0"));;

                parameters[5].Text  = "@gj";
                parameters[5].Value = cmbgj.Text.Trim();

                parameters[6].Text  = "@mz";
                parameters[6].Value = cmbmz.Text.Trim();

                parameters[7].Text  = "@sfzh";
                parameters[7].Value = txtsfzh.Text.Trim();

                parameters[8].Text  = "@cblx";
                parameters[8].Value = Convert.ToInt32(Convertor.IsNull(cmbcblx.SelectedValue, "0"));;

                parameters[9].Text  = "@zy";
                parameters[9].Value = txtzy.Text.Trim();

                parameters[10].Text  = "@csdz";
                parameters[10].Value = txtcsdz.Text.Trim();

                parameters[11].Text  = "@jtdz";
                parameters[11].Value = txtjtdz.Text.Trim();

                parameters[12].Text  = "@gzdw";
                parameters[12].Value = txtgzdw.Text.Trim();

                parameters[13].Text  = "@DJSJ1";
                parameters[13].Value = chkdjsj.Checked == true?dtpdjsj1.Value.ToShortDateString() + " 00:00:00" : "";

                parameters[14].Text  = "@DJSJ2";
                parameters[14].Value = chkdjsj.Checked == true?dtpdjsj2.Value.ToShortDateString() + " 23:59:59" : "";

                parameters[15].Text  = "@CSRQ1";
                parameters[15].Value = chkcsrq.Checked == true?dtpcsrq1.Value.ToShortDateString() + " 00:00:00" : "";

                parameters[16].Text  = "@CSRQ2";
                parameters[16].Value = chkcsrq.Checked == true?dtpcsrq2.Value.ToShortDateString() + " 23:59:59" : "";

                parameters[17].Text  = "@djy";
                parameters[17].Value = Convertor.IsNull(cmbdjy.SelectedValue, "0");

                DataTable tb = TrasenFrame.Forms.FrmMdiMain.Database.GetDataTable("SP_MZSF_CX_BRXX", parameters, 30);

                Fun.AddRowtNo(tb);
                this.dataGridView1.DataSource = tb;
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 13
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DataTable tb = (DataTable)dataGridView1.DataSource;
                if (tb == null)
                {
                    return;
                }
                if (tb.Rows.Count == 0)
                {
                    return;
                }

                int nrow = dataGridView1.CurrentCell.RowIndex;
                int sfy  = Convert.ToInt32(tb.Rows[nrow]["sfy"]);

                ParameterEx[] parameters = new ParameterEx[5];
                parameters[0].Text  = "@pjlx";
                parameters[0].Value = rdogh.Checked == true ? 1 : 0;

                parameters[1].Text  = "@ksh";
                parameters[1].Value = Convertor.IsNull(txtksh.Text, "0");

                parameters[2].Text  = "@jsh";
                parameters[2].Value = Convertor.IsNull(txtjsh.Text, "0");

                parameters[3].Text  = "@sfy";
                parameters[3].Value = sfy;

                parameters[4].Text  = "@type";
                parameters[4].Value = 1;


                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_FPHXHZ", parameters, dset, "sfmx", 30);
                Fun.AddRowtNo(dset.Tables[0]);
                Fun.AddRowtNo(dset.Tables[1]);
                Fun.AddRowtNo(dset.Tables[2]);


                DataTable tb2 = (DataTable)dataGridView2.DataSource;
                DataTable tb3 = (DataTable)dataGridView3.DataSource;
                DataTable tb4 = (DataTable)dataGridView4.DataSource;
                if (tb2 != null)
                {
                    tb2.Rows.Clear();
                }
                if (tb3 != null)
                {
                    tb3.Rows.Clear();
                }
                if (tb4 != null)
                {
                    tb4.Rows.Clear();
                }

                this.dataGridView2.DataSource = dset.Tables[0];
                this.dataGridView3.DataSource = dset.Tables[1];
                this.dataGridView4.DataSource = dset.Tables[2];

                SelectFp(sfy);
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 14
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[9];
                parameters[0].Text  = "@rq1";
                parameters[0].Value = dtp1.Value.ToString();

                parameters[1].Text  = "@rq2";
                parameters[1].Value = dtp2.Value.ToString();

                parameters[2].Text  = "@type";
                parameters[2].Value = rdJg.Checked == true ? 0 : 1;
                //add by Daniel 2014-09-22
                if (cmbQt.SelectedIndex != -1)
                {
                    parameters[2].Text  = "type";
                    parameters[2].Value = cmbQt.SelectedIndex + 2;
                }

                int _jsfs = 0;
                if (rbYb.Checked)
                {
                    _jsfs = 1;
                }
                else if (rbZf.Checked)
                {
                    _jsfs = 2;
                }
                else
                {
                    _jsfs = 0;
                }

                parameters[3].Text  = "@jsfs";
                parameters[3].Value = _jsfs;

                parameters[4].Text  = "@jgbm";
                parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                parameters[5].Text  = "@bks";
                parameters[5].Value = checkBox2.Checked == true ? 1 : 0;

                parameters[6].Text  = "@dept_id";
                parameters[6].Value = Convert.ToInt32(Convertor.IsNull(cmbdept.SelectedValue, "0"));

                parameters[7].Text  = "@sfdeptid";
                parameters[7].Value = this.Cmb_SfDept.SelectedValue.ToString().Trim() == "-1" ? "" : this.Cmb_SfDept.SelectedValue.ToString().Trim();
                //150203 chencan/ 添加"显示病人明细"
                parameters[8].Text  = "@patient";
                parameters[8].Value = ckb_patient.Checked == true ? 1 : 0;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_yssrtj", parameters, dset, "sfmx", 30);
                Fun.AddRowtNo(dset.Tables[0]);
                this.dataGridView1.DataSource = null;
                this.dataGridView1.DataSource = dset.Tables[0];
                this.dataGridView1.Columns["KSDM"].Visible = false;
                this.dataGridView1.Refresh();
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 15
0
        private void GetData()
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[5];



                int ii = 0;
                parameters[ii].Text = "@rq1";
                //if (ckbJkrq.Checked)
                //{
                parameters[ii].Value = dtpBjksj.Value.ToString();
                //}
                //else
                //{
                //parameters[ii].Value ="2000/01/01 00:00:00";
                //}
                ++ii;

                parameters[ii].Text = "@rq2";
                //if (ckbJkrq.Checked)
                //{
                parameters[ii].Value = dtpEjksj.Value.ToString();
                //}
                //else
                //{
                //    parameters[ii].Value = DateTime.Now.AddDays(1).ToString("yyyy/MM/dd HH:mm:ss");
                //}
                ++ii;

                parameters[ii].Text  = "@DeptID";
                parameters[ii].Value = TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId;
                ++ii;

                parameters[ii].Text  = "@inpatientNo";
                parameters[ii].Value = textBox1.Text.Trim();
                ++ii;

                parameters[ii].Text  = "@itemName";
                parameters[ii].Value = textBox2.Text.Trim();
                ++ii;


                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_zy_zxsrtj_mx", parameters, dset, "sfmx", 60);


                Fun.AddRowtNo(dset.Tables[0]);
                DataTable dt = dset.Tables[0];
                dt.Rows[dt.Rows.Count - 1]["住院号"] = "";
                this.dataGridView1.Columns.Clear();
                this.dataGridView1.DataSource = dt;
                for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                {
                    this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                    if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm" || this.dataGridView1.Columns[i].Name.ToLower() == "sort")
                    {
                        this.dataGridView1.Columns[i].Visible = false;
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void btref_Click(object sender, EventArgs e)
        {
            try
            {
                string execdept = "";
                for (int i = 0; i <= TreeDept.Nodes[0].Nodes.Count - 1; i++)
                {
                    if (TreeDept.Nodes[0].Nodes[i].Checked == true)
                    {
                        execdept = execdept + TreeDept.Nodes[0].Nodes[i].Tag + ",";
                    }
                }
                if (execdept != "")
                {
                    execdept = "(" + execdept.Substring(0, execdept.Length - 1) + ")";
                }
                else
                {
                    MessageBox.Show("请选择科室", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                string tjdxm = "";
                for (int i = 0; i <= TreeXm.Nodes[0].Nodes.Count - 1; i++)
                {
                    if (TreeXm.Nodes[0].Nodes[i].Checked == true)
                    {
                        tjdxm = tjdxm + "'" + TreeXm.Nodes[0].Nodes[i].Tag + "',";
                    }
                }
                if (tjdxm != "")
                {
                    tjdxm = "(" + tjdxm.Substring(0, tjdxm.Length - 1) + ")";
                }



                ParameterEx[] parameters = new ParameterEx[8];
                parameters[0].Text  = "@execdept";
                parameters[0].Value = execdept;

                parameters[1].Text  = "@RQ1";
                parameters[1].Value = chksfrq.Checked == true?dtp1.Value.ToString() : "";

                parameters[2].Text  = "@RQ2";
                parameters[2].Value = chksfrq.Checked == true?dtp2.Value.ToString() : "";


                parameters[3].Text  = "@jgbm";
                parameters[3].Value = Convert.ToInt64(cmbjgbm.SelectedValue);

                parameters[4].Text  = "@qrrq1";
                parameters[4].Value = chkqfrq.Checked == true?dtpqrrq1.Value.ToString() : "";

                parameters[5].Text  = "@qrrq2";
                parameters[5].Value = chkqfrq.Checked == true?dtpqrrq2.Value.ToString() : "";

                parameters[6].Text  = "@tjdxm";
                parameters[6].Value = tjdxm;

                parameters[7].Text  = "@zxr";
                parameters[7].Value = 0;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_kssrtj_mx", parameters, dset, "sfmx", 30);
                Fun.AddRowtNo(dset.Tables[0]);
                Fun.AddRowtNo(dset.Tables[1]);
                Fun.AddRowtNo(dset.Tables[2]);
                Fun.AddRowtNo(dset.Tables[3]);

                decimal je  = Convert.ToDecimal(Convertor.IsNull(dset.Tables[0].Compute("sum(金额)", ""), "0"));
                decimal je1 = Convert.ToDecimal(Convertor.IsNull(dset.Tables[1].Compute("sum(金额)", ""), "0"));
                decimal je2 = Convert.ToDecimal(Convertor.IsNull(dset.Tables[2].Compute("sum(金额)", ""), "0"));
                //add by zouchihua 2013-6-25
                decimal je3 = Convert.ToDecimal(Convertor.IsNull(dset.Tables[3].Compute("sum(金额)", ""), "0"));

                DataRow row = dset.Tables[0].NewRow();
                row["序号"] = "合计";
                row["金额"] = je.ToString();
                dset.Tables[0].Rows.Add(row);

                DataRow row1 = dset.Tables[1].NewRow();
                row1["序号"] = "合计";
                row1["金额"] = je1.ToString();
                dset.Tables[1].Rows.Add(row1);

                DataRow row2 = dset.Tables[2].NewRow();
                row2["序号"] = "合计";
                row2["金额"] = je2.ToString();
                dset.Tables[2].Rows.Add(row2);


                DataRow row3 = dset.Tables[3].NewRow();
                row3["序号"] = "合计";
                row3["金额"] = je3.ToString();
                dset.Tables[3].Rows.Add(row3);


                dataGridView1.DataSource = dset.Tables[0];
                dataGridView2.DataSource = dset.Tables[2];
                dataGridView3.DataSource = dset.Tables[1];
                //add by zouchihua 2013-6-25
                dataGridView4.DataSource = dset.Tables[3];
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 17
0
        private void ShowReportData()
        {
            try
            {
                if (string.IsNullOrEmpty(this._param.itemStringOfCol))
                {
                    ParameterEx[] parameters = new ParameterEx[6];


                    parameters[0].Text  = "@sourceType";
                    parameters[0].Value = this._param.sourceType;

                    parameters[1].Text  = "@ksType";
                    parameters[1].Value = this._param.ksType;

                    parameters[2].Text  = "@rq1";
                    parameters[2].Value = this._param.rq1;

                    parameters[3].Text  = "@rq2";
                    parameters[3].Value = this._param.rq2;

                    parameters[4].Text  = "@isZXKS";
                    parameters[4].Value = this._param.isZXKS;

                    parameters[5].Text  = "@departmentID";
                    parameters[5].Value = this._param.departmentID;


                    DataSet dset = new DataSet();
                    if (this._param.itemCode == 0)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("report_BusinessIncomeReport_Drugs_doc", parameters, dset, "sfmx", 30);
                    }
                    else if (this._param.itemCode == 1)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("ReportBuessinessOfMedicalTechnology_doc", parameters, dset, "sfmx", 30);
                    }
                    else if (this._param.itemCode == 2)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("ReportBuessinessOfMediaclServer_doc", parameters, dset, "sfmx", 30);
                    }
                    Fun.AddRowtNo(dset.Tables[0]);
                    this.dataGridView1.DataSource = dset.Tables[0];
                    for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                    {
                        this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                        if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm")
                        {
                            this.dataGridView1.Columns[i].Visible = false;
                        }
                    }
                }
                else
                {
                    ParameterEx[] parameters = new ParameterEx[7];


                    parameters[0].Text  = "@sourceType";
                    parameters[0].Value = this._param.sourceType;

                    parameters[1].Text  = "@ksType";
                    parameters[1].Value = this._param.ksType;

                    parameters[2].Text  = "@rq1";
                    parameters[2].Value = this._param.rq1;

                    parameters[3].Text  = "@rq2";
                    parameters[3].Value = this._param.rq2;

                    parameters[4].Text  = "@isZXKS";
                    parameters[4].Value = this._param.isZXKS;

                    parameters[5].Text  = "@departmentID";
                    parameters[5].Value = this._param.departmentID;

                    parameters[6].Text  = "@itemCode";
                    parameters[6].Value = this._param.itemStringOfCol;


                    DataSet dset = new DataSet();
                    if (this._param.itemCode == 0)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("report_BusinessIncomeReport_DrugItem_doc", parameters, dset, "sfmx", 30);
                    }
                    else if (this._param.itemCode == 1)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("ReportBuessinessOfMedicalTechnology_item_doc", parameters, dset, "sfmx", 30);
                    }
                    else if (this._param.itemCode == 2)
                    {
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("ReportBuessinessOfMediaclServer_item_doc", parameters, dset, "sfmx", 30);
                    }
                    Fun.AddRowtNo(dset.Tables[0]);
                    this.dataGridView1.DataSource = dset.Tables[0];
                    for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                    {
                        this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                        if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm")
                        {
                            this.dataGridView1.Columns[i].Visible = false;
                        }
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 18
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = PubStaticFun.WaitCursor();
                int count = 10;
                if (speci.Equals(1))
                {
                    count = 9;
                }
                //Modify By Kevin 2013-10-16
                ParameterEx[] parameters = new ParameterEx[count];

                parameters[0].Text  = "@RQ1";
                parameters[0].Value = dtp1.Value.ToString();

                parameters[1].Text  = "@RQ2";
                parameters[1].Value = dtp2.Value.ToString();

                int type = 0;
                if (rbJg.Checked)
                {
                    type = 0;
                }
                else
                {
                    type = 1;
                }
                parameters[2].Text  = "@TYPE";
                parameters[2].Value = type;

                int tj_type = 0;
                if (rbJsrq.Checked)
                {
                    tj_type = 1;
                }
                if (rbDqzy.Checked)
                {
                    tj_type = 2;
                }

                parameters[3].Text  = "@TJ_TYPE";
                parameters[3].Value = tj_type;

                parameters[4].Text  = "@YKS";
                parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbZcDept.SelectedValue, "0"));

                parameters[5].Text  = "@XKS";
                parameters[5].Value = Convert.ToInt32(Convertor.IsNull(cmbZrDept.SelectedValue, "0"));

                //Add By Tany 2011-07-04
                parameters[6].Text  = "@ISBRMX";
                parameters[6].Value = chkBrmx.Checked ? 1 : 0;

                //Modify By Tany 2011-12-06 增加机构编码过滤
                parameters[7].Text  = "@JGBM";
                parameters[7].Value = FrmMdiMain.Jgbm;

                parameters[8].Text  = "@ISZRKS";
                parameters[8].Value = chkZrks.Checked ? 1 : 0;

                if (!speci.Equals(1))
                {
                    //Modify By Daniel 2015-01-22 增加住院号
                    parameters[9].Text  = "@ZYH";
                    parameters[9].Value = txtInp_NO.Text.Trim();
                }

                string Sp_name = "[SP_ZY_TJ_BRSRTJ_ZKBR_zyf2]";
                if (speci == 1)
                {
                    Sp_name = "[SP_ZY_TJ_BRSRTJ_ZKBR_ICU]";
                }

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet(Sp_name, parameters, dset, "sfmx", 60);
                Fun.AddRowtNo(dset.Tables[0]);
                DataTable tb = dset.Tables[0];

                tb.Columns["病人科室"].ColumnName = "计费科室";
                //DataTable tb = InstanceForm.BDatabase.GetDataTable(Sp_name, parameters, 120);
                //AddRowtNo(tb);
                if (tb.Columns.Contains("序号") && tb.Rows.Count > 0)
                {
                    tb.Rows[tb.Rows.Count - 1]["序号"] = "合计";
                }
                tb.Columns[3].SetOrdinal(5);
                //tb.Columns[3].SetOrdinal(4);


                this.dataGridView1.Columns.Clear();
                this.dataGridView1.DataSource = tb;
                //Modify By Daniel 2015-01-22 当病人科室与转入科室不一致时,该行背景色变为淡蓝色
                //Begin
                //if (chkBrmx.Checked == true)
                //{
                //    for (int i = 0; i < tb.Rows.Count; i++)
                //    {
                //        if (tb.Rows[i]["病人科室"].ToString() != tb.Rows[i]["转入科室"].ToString())
                //        {
                //            this.dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Aqua;
                //        }
                //    }
                //}
                //End
                //Modify By Daniel 2015-02-11 修改转入科室的背景色为淡蓝色,转出科室的背景色为黄绿色
                this.dataGridView1.Columns["转入科室"].DefaultCellStyle.BackColor = Color.Blue;
                this.dataGridView1.Columns["转出科室"].DefaultCellStyle.BackColor = Color.Yellow;
                for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
                {
                    if (this.dataGridView1.Columns[i].Name == "sort")
                    {
                        this.dataGridView1.Columns[i].Visible = false;
                        break;
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 统计   modify by zp  2013-05-24 存储过程新增入参 株洲省直中医院需求
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    ParameterEx[] parameters = new ParameterEx[8];
                    parameters[0].Text  = "@rq1";
                    parameters[0].Value = dtp1.Value.ToString();

                    parameters[1].Text  = "@rq2";
                    parameters[1].Value = dtp2.Value.ToString();

                    parameters[2].Text  = "@type";
                    parameters[2].Value = cbType.SelectedIndex;//rdJg.Checked == true ? 0 : 1;

                    int _jsfs = cbJsfs.SelectedIndex;

                    parameters[3].Text  = "@jsfs";
                    parameters[3].Value = _jsfs;

                    parameters[4].Text  = "@jgbm";
                    parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                    parameters[5].Text  = "@tjlx";
                    parameters[5].Value = _menuTag.Function_Name == "Fun_ts_mz_tjbb_kssrtj" ? 0 : 1;;

                    parameters[6].Text  = "@include_kdks";
                    parameters[6].Value = chkKdks.Checked ? 1 : 0;

                    parameters[7].Text  = "@sfdeptid";
                    parameters[7].Value = this.Cmb_SfDept.SelectedValue.ToString().Trim() == "-1" ? "" : this.Cmb_SfDept.SelectedValue.ToString().Trim();
                    DataSet dset = new DataSet();
                    TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_Kssrtj", parameters, dset, "sfmx", 30);
                    Fun.AddRowtNo(dset.Tables[0]);


                    this.dataGridView1.DataSource = dset.Tables[0];
                }
                catch
                {
                    try
                    {
                        ParameterEx[] parameters = new ParameterEx[7];
                        parameters[0].Text  = "@rq1";
                        parameters[0].Value = dtp1.Value.ToString();

                        parameters[1].Text  = "@rq2";
                        parameters[1].Value = dtp2.Value.ToString();

                        parameters[2].Text  = "@type";
                        parameters[2].Value = cbType.SelectedIndex;//rdJg.Checked == true ? 0 : 1;

                        int _jsfs = cbJsfs.SelectedIndex;

                        parameters[3].Text  = "@jsfs";
                        parameters[3].Value = _jsfs;

                        parameters[4].Text  = "@jgbm";
                        parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                        parameters[5].Text  = "@tjlx";
                        parameters[5].Value = _menuTag.Function_Name == "Fun_ts_mz_tjbb_kssrtj" ? 0 : 1;;

                        parameters[6].Text  = "@include_kdks";
                        parameters[6].Value = chkKdks.Checked ? 1 : 0;

                        //parameters[7].Text = "@sfdeptid";
                        //parameters[7].Value = this.Cmb_SfDept.SelectedValue.ToString().Trim() == "-1" ? "" : this.Cmb_SfDept.SelectedValue.ToString().Trim();
                        DataSet dset = new DataSet();
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_Kssrtj", parameters, dset, "sfmx", 30);
                        Fun.AddRowtNo(dset.Tables[0]);


                        this.dataGridView1.DataSource = dset.Tables[0];
                    }
                    catch
                    {
                        ParameterEx[] parameters = new ParameterEx[9];
                        parameters[0].Text  = "@rq1";
                        parameters[0].Value = chbSfrq.Checked ? dtp1.Value.ToString() : "";

                        parameters[1].Text  = "@rq2";
                        parameters[1].Value = chbSfrq.Checked ? dtp2.Value.ToString() : "";

                        parameters[2].Text  = "@type";
                        parameters[2].Value = cbType.SelectedIndex;//rdJg.Checked == true ? 0 : 1;

                        int _jsfs = cbJsfs.SelectedIndex;

                        parameters[3].Text  = "@jsfs";
                        parameters[3].Value = _jsfs;

                        parameters[4].Text  = "@jgbm";
                        parameters[4].Value = Convert.ToInt32(Convertor.IsNull(cmbjgbm.SelectedValue, "0"));

                        parameters[5].Text  = "@tjlx";
                        parameters[5].Value = _menuTag.Function_Name == "Fun_ts_mz_tjbb_kssrtj" ? 0 : 1;;

                        parameters[6].Text  = "@include_kdks";
                        parameters[6].Value = chkKdks.Checked ? 1 : 0;

                        parameters[7].Text  = "@jkrq1";
                        parameters[7].Value = ckbJkrq.Checked ? dtpBjksj.Value.ToString() : "";

                        parameters[8].Text  = "@jkrq2";
                        parameters[8].Value = ckbJkrq.Checked ? dtpEjksj.Value.ToString() : "";

                        //parameters[7].Text = "@sfdeptid";
                        //parameters[7].Value = this.Cmb_SfDept.SelectedValue.ToString().Trim() == "-1" ? "" : this.Cmb_SfDept.SelectedValue.ToString().Trim();
                        DataSet dset = new DataSet();
                        TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("SP_MZSF_TJ_SK_Kssrtj", parameters, dset, "sfmx", 30);
                        Fun.AddRowtNo(dset.Tables[0]);
                        this.dataGridView1.DataSource = dset.Tables[0];
                    }
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 20
0
        private DataTable GetDataOfPrint()
        {
            try
            {
                ParameterEx[] parameters = new ParameterEx[10];
                int           ii         = 0;



                parameters[ii].Text  = "@rq1";
                parameters[ii].Value = dtpBjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@rq2";
                parameters[ii].Value = dtpEjksj.Value.ToString();
                ++ii;

                parameters[ii].Text  = "@userName";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@dept";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@inpatientType";
                parameters[ii].Value = comboBox1.Text;
                ++ii;

                parameters[ii].Text  = "@ChargeType";
                parameters[ii].Value = 0;
                ++ii;

                parameters[ii].Text  = "@BillNo";
                parameters[ii].Value = "";
                ++ii;

                parameters[ii].Text  = "@LackNo";
                parameters[ii].Value = Decimal.Parse(textBox3.Text == "" ? "0" : textBox3.Text);
                ++ii;

                parameters[ii].Text  = "@zyh";
                parameters[ii].Value = textBox1.Text;
                ++ii;

                parameters[ii].Text  = "@ReportType";
                parameters[ii].Value = 1;
                ++ii;

                DataSet dset = new DataSet();
                TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("dbo_zy_LackDisChargeReport", parameters, dset, "sfmx", 60);


                Fun.AddRowtNo(dset.Tables[0]);
                DataTable dt = dset.Tables[0];
                return(dt);
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="rq1">登记时间</param>
        /// <param name="rq2">登记时间</param>
        /// <param name="djy">登记员</param>
        /// <param name="shbz">审核标志 0 为未入院审核的记录 1为已审核</param>
        /// <param name="brxxid">病人信息id</param>
        /// <param name="_DataBase"></param>
        /// <returns></returns>
        public static DataTable GetRecord(string rq1, string rq2, long djy, int shbz, int klx, string kh, string brxm, Guid brxxid, RelationalDatabase _DataBase)
        {
            //string ssql = "select '' 序号,brxm 姓名,dbo.FUN_ZY_SEEKSEXNAME(xb) 性别,dbo.fun_zy_age(csrq,3,getdate()) 年龄,mzzdmc 门诊诊断,"+
            //" dbo.fun_getdeptname(dryks) 入院科室,jyyj 建议押金,c.name 入院途径,bz 备注,BRYBZ 已入院,rydjsj 入院登记时间,b.id,  dbo.fun_getDeptname(tjks) AS 登记科室, "+
            //"dbo.fun_getEmpName(a.DJY) AS 登记医生,"+
            //"a.DJSJ 登记时间  "+
            //",mzh 门诊号 from YY_BRXX a  inner join mzys_zyzdj b on a.brxxid=b.brxxid left join jc_rytj c on b.rytj=c.id "+
            //" left join yy_kdjb d on a.brxxid=d.brxxid and zfbz=0 where b.bscbz=0 ";

            // 上面注释的查询语句错误  modify by fangke 2014.11.18
            string ssql = @"SELECT '' 序号,
                                    yb.BRXM 姓名,
                                    dbo.FUN_ZY_SEEKSEXNAME(yb.XB) 性别,
                                    dbo.fun_zy_age(yb.CSRQ,3,getdate()) 年龄,
                                    mz.MZZDMC 门诊诊断,
                                    dbo.fun_getdeptname(mz.DRYKS) 入院科室,
                                    mz.JYYJ 建议押金,
                                    jr.NAME 入院途径,
                                    mz.BZ 备注,
                                    mz.BRYBZ 已入院,
                                    mz.RYDJSJ 入院登记时间,
                                    mz.ID,
                                    dbo.fun_getDeptname(mz.TJKS) AS 登记科室, 
                                    dbo.fun_getEmpName(mz.DJY) AS 登记医生,
                                    mz.DJSJ 登记时间,
                                    mz.MZH 门诊号 
                                    FROM MZYS_ZYZDJ AS mz 
                                    LEFT JOIN YY_BRXX AS yb
                                    ON mz.BRXXID = yb.BRXXID
                                    LEFT JOIN JC_RYTJ AS jr
                                    ON mz.RYTJ = jr.ID
                                    LEFT JOIN YY_KDJB AS yk
                                    ON mz.BRXXID = yk.BRXXID AND yk.ZFBZ = 0
                                    WHERE mz.BSCBZ<>1 ";
            //150204  chencan 过滤过期的住院证
            SystemCfg cfg5152 = new SystemCfg(5152);

            if (!String.IsNullOrEmpty(cfg5152.Config))
            {
                try
                {
                    ssql += string.Format(" and mz.djsj+{0}>=getdate()", Int32.Parse(cfg5152.Config));
                }
                catch { }
            }
            if (rq1 != "")
            {
                ssql = ssql + " and mz.DJSJ BETWEEN '" + rq1 + " 00:00:00' and '" + rq2 + " 23:59:59'";
            }
            if (brxxid != Guid.Empty)
            {
                ssql = ssql + " and mz.BRXXID='" + brxxid + "'";
            }
            if (kh != "")
            {
                ssql = ssql + " and yk.KH='" + kh + "' and KLX=" + klx + " ";
            }
            if (brxm != "")
            {
                ssql = ssql + " and yb.BRXM like '%" + brxm + "%'";
            }
            if (shbz >= 0)
            {
                ssql = ssql + " and mz.BRYBZ=" + shbz + "";
            }
            DataTable tb = _DataBase.GetDataTable(ssql);

            Fun.AddRowtNo(tb);
            return(tb);
        }
Ejemplo n.º 22
0
        private void buttj_Click(object sender, EventArgs e)
        {
            try
            {
                if (radioButton2.Checked == true)
                {
                    ParameterEx[] parameters1 = new ParameterEx[3];

                    parameters1[0].Text  = "@KSRQ";
                    parameters1[0].Value = dtp1.Value.ToString();

                    parameters1[1].Text  = "@JSRQ";
                    parameters1[1].Value = dtp2.Value.ToString();

                    parameters1[2].Text  = "@jky";
                    parameters1[2].Value = 0;

                    dset = new DataSet();
                    InstanceForm.BDatabase.AdapterFillDataSet("SP_MZSF_TJ_JK_TJ_YJJCX", parameters1, dset, "sfmx", 30);
                    Fun.AddRowtNo(dset.Tables[0]);
                    this.dataGridView1.DataSource = dset.Tables[0];

                    for (int i = 0; i <= dset.Tables[0].Columns.Count - 1; i++)
                    {
                        if (i > 1)
                        {
                            dataGridView1.Columns[i].Width = 70;
                        }
                        if (dataGridView1.Columns[i].HeaderText == "缴款日期")
                        {
                            dataGridView1.Columns[i].Width = 120;
                        }
                    }

                    //Mod by Hxy 20150110 设置金额以及数量列靠右。
                    this.DGVFormat();
                    return;
                }


                if (dtpjsrq2.Value > DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase) && radioButton1.Checked == true)
                {
                    MessageBox.Show("统计时间不能大于当前系统时间", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                ParameterEx[] parameters = new ParameterEx[3];

                parameters[0].Text  = "@sky";
                parameters[0].Value = 0;

                parameters[1].Text  = "@jsrq";
                parameters[1].Value = dtpjsrq2.Value.ToString();

                parameters[2].Text          = "@err_text";
                parameters[2].ParaDirection = ParameterDirection.Output;
                parameters[2].ParaSize      = 100;

                dset = new DataSet();
                InstanceForm.BDatabase.AdapterFillDataSet("SP_MZSF_TJ_JK_TJ_YJJ", parameters, dset, "sfmx", 30);

                string err_text = Convertor.IsNull(parameters[2].Value, "");

                if (err_text != "")
                {
                    MessageBox.Show(err_text, "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    butjk.Enabled = false;
                }
                dset.Tables[0].Columns.Add("jkid"); //add by wangzhi 2014-08-05 加jkid列,与历史查询保持输出到报表的列一致,不然会导致打印时收费员列显示不正确
                Fun.AddRowtNo(dset.Tables[0]);

                this.dataGridView1.DataSource = dset.Tables[0];
                yjjrow = Convert.ToInt32(Convertor.IsNull(dset.Tables[2].Rows[0][0], "0"));
                fpbrow = Convert.ToInt32(Convertor.IsNull(dset.Tables[2].Rows[0][1], "0"));

                for (int i = 0; i <= dset.Tables[0].Columns.Count - 1; i++)
                {
                    if (i > 1)
                    {
                        dataGridView1.Columns[i].Width = 70;
                    }
                }
                //Mod by Hxy 20150110 设置金额以及数量列靠右。
                this.DGVFormat();

                butjk.Enabled = true;
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 23
0
        private void GetData()
        {
            ParameterEx[] parameters = new ParameterEx[4];


            parameters[0].Text  = "@rq1";
            parameters[0].Value = dtpBjksj.Value.ToString();

            parameters[1].Text  = "@rq2";
            parameters[1].Value = dtpEjksj.Value.ToString();

            parameters[2].Text  = "@deptID";
            parameters[2].Value = TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId;


            parameters[3].Text = "@mzh";
            if (this.checkBox1.Checked == false)
            {
                parameters[3].Value = "0";
            }
            else
            {
                if (string.IsNullOrEmpty(this.textBox1.Text))
                {
                    parameters[3].Value = "0";
                }
                else
                {
                    parameters[3].Value = this.textBox1.Text;
                }
            }



            DataSet dset = new DataSet();

            TrasenFrame.Forms.FrmMdiMain.Database.AdapterFillDataSet("sp_Mz_BusinessOfZXKS", parameters, dset, "sfmx", 60);

            DataTable dt = dset.Tables[0];

            if (dt.Rows.Count > 0)
            {
                decimal sum = 0;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sum += decimal.Parse(dt.Rows[i]["金额"].ToString());
                }
                string[] data = new string[6];
                data[0] = "合计";
                data[5] = sum.ToString();
                dt.Rows.Add(data);
            }
            else
            {
                MessageBox.Show("没有找到数据");
                return;
            }

            Fun.AddRowtNo(dt);
            this.dataGridView1.DataSource = dt;
            for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
            {
                this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                if (this.dataGridView1.Columns[i].Name.ToLower() == "ksdm" || dset.Tables[0].Columns[i].ColumnName.ToLower() == "cfid")
                {
                    this.dataGridView1.Columns[i].Visible = false;
                }
            }
        }