Exemple #1
0
        private void btn_bzsf_Click(object sender, EventArgs e)
        {
            #region 输入检查
            if (str_tjbh_bz == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }
            if (str_tjcs_bz == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }
            if (txt_sfbeizhu.Text == "")
            {
                MessageBox.Show("请输入收费备注!费办卡可以输入收费项目名称!", "提示");
                this.ActiveControl = txt_sfbeizhu;
                return;
            }


            Common.Common comn = new Common.Common();

            if (comn.DoubleYz(txt_bzsfje.Text.Trim()) == -1 || comn.Szyz(txt_bzsfje.Text.Trim()) == -1)  //既不是双精度又不是数字
            {
                MessageBox.Show("请输入正确的金额格式,如:100.5或100", "提示");
                txt_je.Focus();
                return;
            }
            #endregion

            string sfh = xtbiz.GetHmz("tj_sjh", 1);
            #region 办证收费保存,打印
            try
            {
                int k = tjdjbiz.TjSf(sfh, str_tjbh_bz, str_tjcs_bz, Program.userid, Convert.ToDecimal(txt_bzsfje.Text.Trim()), Convert.ToDecimal(txt_bzsfje.Text.Trim()), 2, 0, sfh, txt_sfbeizhu.Text.Trim());
                if (k > 0)
                {
                    MessageBox.Show("收费成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    #region 日志记录
                    loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上补证收费成功,收费号是:" + sfh + ",IP:" + Program.hostip, Program.username);
                    #endregion
                    button1_Click(null, null);
                    btn_bzsf.Enabled = false;
                    string sfdyfp = xtbiz.GetXtCsz("sfdybzfp"); //是否打印办证收费发票
                    if (sfdyfp == "1")                          //1打印,0不打印
                    {
                        PrintRdlc(str_tjbh_bz, str_tjcs_bz, sfh);
                    }
                }
            }
            catch (Exception ex)
            {
                #region 错误日志
                loginbiz.WriteLogErr(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上收补证费出现异常,错误原因:" + ex.ToString() + ",IP:" + Program.hostip, Program.username);
                #endregion
                MessageBox.Show(ex.ToString());
                btn_bzsf.Enabled = false;
                return;
            }
            #endregion
        }
        private void btnPrintFm_Click(object sender, EventArgs e)
        {
            string ys = txtYs.Text.Trim();
            ys = comn.CharConverter(ys);
            if (comn.Szyz(ys) == -1)
            {
                MessageBox.Show("页数格式错误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (dtpFrom.Value > dtpTo.Value)
            {
                MessageBox.Show("开始日期不能大于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = dtpFrom;
                return;
            }

            if (txtDw.Text == "")
            {
                txtDw.Tag = "";
                MessageBox.Show("请选择体检单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            pw.StartThread();
            string str_dwbh = txtDw.Tag.ToString().Trim();
            string str_bmbh = "";
            if (str_dwbh.Length > 4)
            {
                str_bmbh = str_dwbh;
                str_dwbh = str_dwbh.Substring(0, 4);
            }
            LocalReport report = new LocalReport();
            report.ReportPath = Application.StartupPath + @"/rdlcreport/Report_jcjg_fm.rdlc";
            report.EnableExternalImages = true;
            DateTime dqrq = xtbiz.GetDataNow();


            string pagesl="";
            if (txtYs.Text.Trim() == "1") pagesl = "一";
            if (txtYs.Text.Trim() == "2") pagesl = "二";
            if (txtYs.Text.Trim() == "3") pagesl = "三";
            if (txtYs.Text.Trim() == "4") pagesl = "四";
            if (txtYs.Text.Trim() == "5") pagesl = "五";
            if (txtYs.Text.Trim() == "6") pagesl = "六";
            if (txtYs.Text.Trim() == "7") pagesl = "七";
            if (txtYs.Text.Trim() == "8") pagesl = "八";
            if (txtYs.Text.Trim() == "9") pagesl = "九";
            if (txtYs.Text.Trim() == "10") pagesl = "十";
            if (txtYs.Text.Trim() == "11") pagesl = "十一";
            if (txtYs.Text.Trim() == "12") pagesl = "十二";
            if (txtYs.Text.Trim() == "13") pagesl = "十三";
            if (txtYs.Text.Trim() == "14") pagesl = "十四";
            if (txtYs.Text.Trim() == "15") pagesl = "十五";
            if (txtYs.Text.Trim() == "16") pagesl = "十六";
            if (txtYs.Text.Trim() == "17") pagesl = "十七";
            if (txtYs.Text.Trim() == "18") pagesl = "十八";
            if (txtYs.Text.Trim() == "19") pagesl = "十九";
            if (txtYs.Text.Trim() == "20") pagesl = "二十";

            
            ReportParameter rp1 = new ReportParameter("dwmc", txtDw.Text.Trim());
           
            ReportParameter rp3 = new ReportParameter("bgrq", tzs.ChangeTime(dqrq));
         
            ReportParameter rp5 = new ReportParameter("ys", pagesl);
            
            ReportParameter rp4 = new ReportParameter("bbmc", Program.sys_reportname);

            report.DataSources.Clear();
            report.SetParameters(new ReportParameter[] { rp1,  rp3, rp5 ,rp4});



            RdlcPrintNew rdlcprint = new RdlcPrintNew();
            rdlcprint.Hxdy = true;
            rdlcprint.Run(report, "体检通知书封面", false, "tjjgdy");
            pw.StopThread();

            #region 日志记录
            loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上打印了职业健康汇总报告封面页!IP:" + Program.hostip, Program.username);
            #endregion
        }
Exemple #3
0
        private void btnSf_Click(object sender, EventArgs e)
        {
            #region 输入检查
            if (str_tjbh == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }
            if (str_tjcs == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }

            Common.Common comn = new Common.Common();
            if (rbt_je.Checked == true)
            {
                if (comn.DoubleYz(txt_je.Text.Trim()) == -1 || comn.Szyz(txt_je.Text.Trim()) == -1)  //既不是双精度又不是数字
                {
                    MessageBox.Show("请输入正确的金额格式,如:100.5或100", "提示");
                    txt_je.Focus();
                    return;
                }
                if (Convert.ToDecimal(txt_je.Text.Trim()) > ysje)
                {
                    MessageBox.Show("最大金额优惠不能大于应收金额!", "提示");
                    txt_je.Focus();
                    return;
                }
                if (txt_yhbz.Text == "")
                {
                    MessageBox.Show("请输入优惠备注信息!", "提示");
                    txt_yhbz.Focus();
                    return;
                }
            }
            if (rbt_bl.Checked == true)
            {
                if (comn.DoubleYz(txt_bl.Text.Trim()) == -1 || comn.Szyz(txt_bl.Text.Trim()) == -1)  //既不是双精度又不是数字
                {
                    MessageBox.Show("请输入正确的比例格式,如:9或9.5", "提示");
                    txt_bl.Focus();
                    return;
                }
                if (Convert.ToDecimal(txt_bl.Text.Trim()) > 100)
                {
                    MessageBox.Show("优惠比例不能大于或等于100!", "提示");
                    txt_je.Focus();
                    return;
                }
                if (txt_yhbz.Text == "")
                {
                    MessageBox.Show("请输入优惠备注信息!", "提示");
                    txt_yhbz.Focus();
                    return;
                }
            }
            #endregion

            string sfh = xtbiz.GetHmz("tj_sjh", 1);
            str_sfhdy = sfh;
            #region 优惠处理
            int     yhlx = 0;
            decimal ssje = 0;
            decimal yhxx = 0;

            if (rbt_je.Checked == true || txt_je.Text.Trim() != "")
            {
                yhlx = 1;                                     //金额优惠
                yhxx = Convert.ToDecimal(txt_je.Text.Trim()); //优惠信息
                ssje = ysje - yhxx;                           //应收-优惠金额
            }

            if (rbt_bl.Checked == true || txt_bl.Text.Trim() != "")
            {
                yhlx = 2;                          //比例优惠
                yhxx = Convert.ToDecimal(txt_bl.Text.Trim());
                ssje = ysje - ysje * (yhxx / 100); //应收-应收*优惠比例
            }

            if (rbt_bl.Checked == false && rbt_je.Checked == false)
            {
                ssje = ysje;
            }

            #endregion

            #region 收费保存,打印
            try
            {
                int k = tjdjbiz.TjSf(sfh, str_tjbh, str_tjcs, Program.userid, ysje, ssje, yhlx, yhxx, sfh, txt_yhbz.Text.Trim());
                if (k > 0)
                {
                    MessageBox.Show("收费成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    #region 日志记录
                    loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上收费成功,收费号是:" + sfh + ",IP:" + Program.hostip, Program.username);
                    #endregion

                    txt_bl.Text = "";
                    txt_je.Text = "";
                    btn_query_Click(null, null);
                    dgvFyxx.DataSource = tjdjbiz.GetTjfyxx("", "");;
                    btnSf.Enabled      = false;
                    string sfdyfp = xtbiz.GetXtCsz("sfdyfp"); //是否打印收费发票
                    if (sfdyfp == "1")                        //1打印,0不打印
                    {
                        PrintRdlc(str_tjbh, str_tjcs, sfh);
                    }
                }
            }
            catch (Exception ex)
            {
                #region 错误日志
                loginbiz.WriteLogErr(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上收费是出现异常,错误原因:" + ex.ToString() + ",IP:" + Program.hostip, Program.username);
                #endregion

                MessageBox.Show(ex.ToString());
                return;
            }
            #endregion
        }