示例#1
0
        private void lv_tc_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = lv_tc.GetItemAt(e.X, e.Y);

            if (object.Equals(null, item))
            {
                return;
            }

            DataTable dt       = ywszbiz.Get_tj_tc_dt(item.Tag.ToString().Trim());
            tjdjBiz   tjglbiz1 = new tjdjBiz();

            foreach (DataRow dr in dt.Rows)
            {
                ListViewItem item1 = new ListViewItem();
                item1.Tag  = dr["zhxm"].ToString().Trim();
                item1.Text = dr["mc"].ToString().Trim();
                if (!Check_lv_checkxm_Exists(item1.Tag.ToString().Trim()))//不存在
                {
                    DataTable dt_tj_zhxm_hd = tjglbiz.Get_tj_zhxm_hd(item1.Tag.ToString().Trim());
                    string    str_xh        = xtbiz.GetHmz("tjjlbxh", 1);//体检记录本序号
                    string    str_lxbh      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                    string    str_tjxmbh    = dt_tj_zhxm_hd.Rows[0]["bh"].ToString().Trim();
                    string    str_xmdj      = dt_tj_zhxm_hd.Rows[0]["dj"].ToString().Trim();
                    string    str_zxks      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                    string    str_xmlx      = dt_tj_zhxm_hd.Rows[0]["jcjylx"].ToString().Trim();
                    string    str_sflb      = dt_tj_zhxm_hd.Rows[0]["sflb"].ToString().Trim();

                    tjglbiz1.str_Insert_tj_tjjlb(str_xh, str_tjbh, str_tjcs, str_lxbh, str_tjrq, str_tjxmbh, str_xmdj, "0", "1", str_sflb, str_zxks, str_xmlx);
                    lv_checkxm.Items.Add(item1);
                }
            }
            tjglbiz1.Exec_ArryList();
        }
        private void bt_add_Click(object sender, EventArgs e)
        {
            if (txt_xm.Text.Trim() == "")
            {
                MessageBox.Show("请填写姓名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_xm;
                return;
            }
            if (object.Equals(null, cmb_xb.SelectedValue))
            {
                MessageBox.Show("请选择性别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_xb;
                return;
            }
            try
            {
                Convert.ToInt32(txt_nl.Text);
            }
            catch
            {
                MessageBox.Show("请填写年龄!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_nl;
                return;
            }
            //if (txt_nl.Text.Trim() == "")
            //{
            //    MessageBox.Show("请填写年龄!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    this.ActiveControl = txt_nl;
            //    return;
            //}
            if (object.Equals(null, cmb_mz.SelectedValue))
            {
                MessageBox.Show("请选择民族!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_mz;
                return;
            }

            string tjrq = xtbiz.GetServerDate().ToString("yyyy-MM-dd");

            if (str_tjbh == "")
            {
                str_tjbh = xtbiz.GetHmz("tjbh", 1);
                str_tjcs = "1";

                if (xtbiz.GetXtCsz("djlshgz") == "2")  //特殊规则YYMMDD+5位
                {
                    str_djlsh = xtbiz.GetHmz("djlsh", 1);
                }
                else
                {
                    str_djlsh = tjdjbiz.Get_proc_get_djlsh(tjrq, Program.userid);
                }
            }
            tjjgbiz.Insert_tj_tjdjb(str_djlsh, str_tjbh, str_tjcs, txt_xm.Text.Trim(), cmb_xb.SelectedValue.ToString(), txt_nl.Text.Trim(), cmb_mz.SelectedValue.ToString(), txt_mobile.Text.Trim(), "05", tjrq, txt_sfzh.Text.Trim());

            this.DialogResult = DialogResult.OK;
        }
示例#3
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (txt_mbmc.Text.Trim() == "")
            {
                MessageBox.Show("请填写模板名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_mbmc;
                return;
            }
            if (txt_bh.Text.Trim() == "")
            {
                txt_bh.Text = xtbiz.GetHmz("jbmbid", 1);
            }
            if (txt_disp_order.Text.Trim() == "")
            {
                txt_disp_order.Text = txt_bh.Text;
            }
            str_bh = txt_bh.Text.Trim();

            ywszBiz ywszbiz1 = new ywszBiz();

            ywszbiz1.str_Insert_tj_xmmb_hd(txt_bh.Text.Trim(), txt_disp_order.Text.Trim(), txt_mbmc.Text.Trim(), txt_bz.Text.Trim());
            ywszbiz1.Exec_ArryList();
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DataBind();
        }
示例#4
0
        private void bt_insert_Click(object sender, EventArgs e)
        {
            if (dgv_tjdjb.Rows.Count < 1)
            {
                return;
            }

            if (txt_zhxm.Text.Trim() == "")
            {
                MessageBox.Show("请选择组合项目名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_zhxm;
                return;
            }
            bool    exists   = false;//是否选择了人员
            tjdjBiz tjdjbiz1 = new tjdjBiz();

            foreach (DataGridViewRow dgr in dgv_tjdjb.Rows)
            {
                if (dgr.Cells["selected"].Value.ToString().Trim() == "1")
                {
                    exists = true;
                    string str_tjbh    = dgr.Cells["tjbh"].Value.ToString().Trim();
                    string str_tjcs    = dgr.Cells["tjcs"].Value.ToString().Trim();
                    string str_tjrq    = dgr.Cells["tjrq"].Value.ToString().Trim();
                    string str_sumover = dgr.Cells["sumover"].Value.ToString().Trim();
                    if (str_sumover == "2")//总检
                    {
                        MessageBox.Show("体检编号为:【" + str_tjbh + "】的人员已经总检,不允许调整项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        continue;
                    }
                    if (tjdjbiz1.Existes_tj_tjjlb(str_tjbh, str_tjcs, txt_zhxm.Tag.ToString().Trim())) //是否存在该组合项目ID
                    {
                        MessageBox.Show("体检编号为:【" + str_tjbh + "】的人员已存在该体检项目,不允许重复添加该项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        continue;
                    }
                    DataTable dt_tj_zhxm_hd = tjdjbiz.Get_tj_zhxm_hd(txt_zhxm.Tag.ToString().Trim());
                    string    str_xh        = xtbiz.GetHmz("tjjlbxh", 1);//体检记录本序号
                    string    str_lxbh      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                    string    str_tjxmbh    = dt_tj_zhxm_hd.Rows[0]["bh"].ToString().Trim();
                    string    str_xmdj      = dt_tj_zhxm_hd.Rows[0]["dj"].ToString().Trim();
                    string    str_zxks      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                    string    str_xmlx      = dt_tj_zhxm_hd.Rows[0]["jcjylx"].ToString().Trim();
                    string    str_sflb      = dt_tj_zhxm_hd.Rows[0]["sflb"].ToString().Trim();
                    tjdjbiz1.str_Insert_tj_tjjlb(str_xh, str_tjbh, str_tjcs, str_lxbh, str_tjrq, str_tjxmbh, str_xmdj, "0", "1", str_sflb, str_zxks, str_xmlx);
                }
            }
            if (!exists)//没有选择人员
            {
                return;
            }
            tjdjbiz1.Exec_ArryList();
            MessageBox.Show("批量调整成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            if (!object.Equals(null, dgv_tjdjb.CurrentRow))
            {
                BindYxzhxm(dgv_tjdjb.CurrentRow);
            }
            txt_zhxm.Text = "";
            txt_zhxm.Tag  = "";
        }
示例#5
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            xtBiz   xtbiz = new xtBiz();
            DataRow dr    = dt.NewRow();

            dr[3] = Convert.ToInt16(xtbiz.GetHmz("xtgnid", 1));
            dr[4] = Convert.ToInt16(treeView1.SelectedNode.Name);
            dt.Rows.Add(dr);
        }
示例#6
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    i;
            string xmbh = txtXmbh.Text.Trim();
            string bl   = txtBl.Text.Trim();

            if (bl == "")
            {
                bl = "1";
            }
            if (comn.DoubleYz(bl) == -1)
            {
                MessageBox.Show("数字格式错误!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (add)//增加
            {
                if (txtXmmc.Text.Trim() == "")
                {
                    MessageBox.Show("项目名称不能为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                xtBiz xtBiz = new xtBiz();
                xmbh         = xtBiz.GetHmz("jy_xmbh", 1);
                txtXmbh.Text = xmbh;
                i            = jyjkBiz.InsertJyxmb(xmbh, this.jyjxbh, txtXmmc.Text.Trim(), txtXmsx.Text.Trim(), txtDy.Text.Trim(),
                                                   txtXy.Text.Trim(), txtSpy.Text.Trim(), txtXpy.Text.Trim(), txtDw.Text.Trim(), txtMrjg.Text.Trim());
            }
            else
            {
                i = jyjkBiz.UpdateJyxmb(xmbh, cbxTy.Checked, txtXmsx.Text.Trim(), txtDy.Text.Trim(), txtXy.Text.Trim(), txtSpy.Text.Trim(),
                                        txtXpy.Text.Trim(), txtXmmc.Text.Trim(), txtBl.Text.Trim(), txtXssx.Text.Trim(), txtDw.Text.Trim(), txtMrjg.Text.Trim());
            }

            if (i > 0)
            {
                MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (add)
                {
                    Clear();
                }
                else
                {
                    this.DialogResult = DialogResult.Yes;
                }
            }
        }
示例#7
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (txt_flmc.Text.Trim() == "")
            {
                MessageBox.Show("请填写分类名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_flmc;
                return;
            }
            if (object.Equals(null, cmb_jcjylx.SelectedValue))
            {
                MessageBox.Show("请选择检查类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_jcjylx;
                return;
            }
            if (cmb_jcjylx.SelectedValue.ToString().Trim() == "0" && object.Equals(null, cmb_bblx.SelectedValue))
            {
                MessageBox.Show("请选择标本类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_bblx;
                return;
            }
            string str_bblx = "";

            try
            {
                str_bblx = cmb_bblx.SelectedValue.ToString().Trim();
            }
            catch
            {
            }
            if (txt_flbh.Text.Trim() == "")
            {
                txt_flbh.Text = xtbiz.GetHmz("sqdflbh", 1);
            }
            if (txt_disp_order.Text.Trim() == "")
            {
                txt_disp_order.Text = txt_flbh.Text;
            }
            str_flbh   = txt_flbh.Text.Trim();
            str_jcjylx = cmb_jcjylx.SelectedValue.ToString().Trim();
            ywszBiz ywszbiz1 = new ywszBiz();

            ywszbiz1.str_Insert_tj_sqdlx_hd(txt_flbh.Text.Trim(), txt_disp_order.Text.Trim(), txt_flmc.Text.Trim(), str_jcjylx, str_bblx, txt_bz.Text.Trim());
            ywszbiz1.Exec_ArryList();
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DataBind();
        }
示例#8
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (object.Equals(null, cmb_xb.SelectedValue))
            {
                MessageBox.Show("请选择性别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_xb;
                return;
            }
            if (txt_mc.Text.Trim() == "")
            {
                MessageBox.Show("请填写套餐名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_mc;
                return;
            }
            if (object.Equals(null, cmb_tjywlx.SelectedValue))
            {
                MessageBox.Show("请选择业务类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_tjywlx;
                return;
            }

            if (lv_tjtcxm.Items.Count <= 0)
            {
                MessageBox.Show("体检套餐项目不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //this.ActiveControl = cmb_tjywlx;
                return;
            }

            if (txt_bh.Text.Trim() == "")
            {
                str_bh      = xtbiz.GetHmz("tcid", 1);
                txt_bh.Text = str_bh;
            }
            ywszBiz ywszbiz1 = new ywszBiz();

            ywszbiz1.str_Insert_tj_tc_hd(txt_bh.Text.Trim(), txt_disp_order.Text.Trim(), cmb_xb.SelectedValue.ToString().Trim(), txt_mc.Text.Trim(),
                                         txt_jc.Text.Trim(), txt_bzjg.Text.Trim(), txt_jg.Text.Trim(), cmb_tjywlx.SelectedValue.ToString().Trim(), txt_bz.Text.Trim());
            ywszbiz1.str_Delete_tj_tc_dc(str_bh);
            foreach (ListViewItem item in lv_tjtcxm.Items)
            {
                ywszbiz1.str_Insert_tj_tc_dc(str_bh, item.Tag.ToString().Trim());
            }
            ywszbiz1.Exec_ArryList();
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DataBind();
        }
示例#9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtDw.Text.Trim()=="")
            {
                return;
            }

            int type = -1;//插入
            if (strBgid=="")
            {
                type = -1;
                strBgid = xtbiz.GetHmz("sz_bgid", 1);
            }
            else
            {
                type = 1;
            }

            tjjgBiz.GxTjbgSz(GetTjbg(strBgid), GetMxes(strBgid), type);
            MessageBox.Show("保存成功!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
            strBgid = "";
            LoadTjxm();
        }
示例#10
0
        private void button2_Click(object sender, EventArgs e)
        {
            #region  收费检查
            string str_bzsfxz = xtbiz.GetXtCsz("bzsfxz"); //办证收费流程限制
            if (str_bzsfxz == "1" && str_sfbz == "1")     //限制
            {
                int sl = tjdjBiz.TjSfCx(str_tjbh, str_tjcs);
                if (sl <= 0)    //未收费
                {
                    MessageBox.Show("本单位进行了财务流程控制,请先交费!", "提示");
                    return;
                }
            }
            #endregion

            #region 检查输入
            if (txtJkzXm.Text.Trim() == "")
            {
                MessageBox.Show("请输入姓名!", "提示");
                this.ActiveControl = txtJkzXm;
                return;
            }
            if (txtNl.Text.Trim() == "")
            {
                MessageBox.Show("请输入年龄!", "提示");
                this.ActiveControl = txtNl;
                return;
            }
            if (txtXb.Text.Trim() == "")
            {
                MessageBox.Show("请输入性别!", "提示");
                this.ActiveControl = txtXb;
                return;
            }
            if (txtTjbh.Text.Trim() == "")
            {
                MessageBox.Show("请输入体检编号!", "提示");
                this.ActiveControl = txtTjbh;
                return;
            }
            if (txtJdhdw.Text.Trim() == "")
            {
                MessageBox.Show("请输入街道或单位地址!", "提示");
                this.ActiveControl = txtJdhdw;
                return;
            }
            if (txt_yxq.Text.Trim() == "")
            {
                MessageBox.Show("请输入有效期!", "提示");
                this.ActiveControl = txt_yxq;
                return;
            }
            if (cmbHy.Text.Trim() == "")
            {
                MessageBox.Show("请选择行业!", "提示");
                this.ActiveControl = cmbHy;
                return;
            }
            if (txt_gz.Text.Trim() == "")
            {
                MessageBox.Show("请选择工种!", "提示");
                this.ActiveControl = txt_gz;
                return;
            }
            if (cmbCylx.Text.Trim() == "")
            {
                MessageBox.Show("请选择所属证类!", "提示");
                this.ActiveControl = cmbCylx;
                return;
            }
            if (txt_yxq.Text.Trim() != "1" && txt_yxq.Text.Trim() != "2")
            {
                MessageBox.Show("健康证有效期为1年或2年!", "提示");
                this.ActiveControl = txt_yxq;
                return;
            }
            #endregion

            #region 保存
            string str_bfrq = "";
            if (ckb_bfbz.Checked == true)    //如果是补发证
            {
                str_bfrq = dtp_fzrq.Value.ToString("yyyy-MM-dd");
            }
            else
            {
                str_bfrq = xtbiz.GetServerDate().ToString("yyyy-MM-dd");
            }

            if (str_jkzbh == "0")  //新增
            {
                string jkzbh = xtbiz.GetHmz("tj_jkzbh", 1);
                if (jkzbh.Length == 1)
                {
                    jkzbh = "0000" + jkzbh;
                }
                if (jkzbh.Length == 2)
                {
                    jkzbh = "000" + jkzbh;
                }
                if (jkzbh.Length == 3)
                {
                    jkzbh = "00" + jkzbh;
                }
                if (jkzbh.Length == 4)
                {
                    jkzbh = "0" + jkzbh;
                }

                string jkzbm = xtbiz.GetXtCsz("jkzbm");   //20111111
                jkzbh = jkzbm + "  " + cmbCylx.Text.Trim() + str_bfrq.Replace("-", "").Substring(0, 4) + jkzbh;

                try
                {
                    int i = tjdjBiz.TjJkzSave(jkzbh, str_tjbh, str_tjcs, str_xm, str_nl, str_xb, Program.yljgmc, str_bfrq, Program.userid, cmbHy.Text.Trim(), cmbCylx.Text.Trim(), str_bfrq, Convert.ToDateTime(str_bfrq).AddYears(Convert.ToInt16(txt_yxq.Text.Trim())).ToString("yyyy-MM-dd"), txtHjd.Text.Trim(), txtXjdz.Text.Trim(), txtJdhdw.Text.Trim(), txt_gz.Text.Trim());
                    if (i > 0)
                    {
                        MessageBox.Show("保存成功!", "提示");
                        #region 日志记录
                        loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上保存" + str_tjbh + "的健康证信息成功!IP:" + Program.hostip, Program.username);
                        #endregion
                        btnSearch_Click(null, null);
                        //Init();
                        txt_yxq.ReadOnly = true;
                        txtTjbh.ReadOnly = true;
                        //cbx_gz.Enabled = true;
                        ckb_bfbz.Checked  = false;
                        txt_gz.ReadOnly   = true;
                        txtJdhdw.ReadOnly = true;
                        txtJkzXm.ReadOnly = true;
                        txtXb.ReadOnly    = true;
                        txtNl.ReadOnly    = true;
                        txtTjbh.ReadOnly  = true;
                    }
                }
                catch (Exception ex)
                {
                    #region 日志记录
                    loginbiz.WriteLogErr(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上保存" + str_tjbh + "的健康证信息失败,原因:" + ex.ToString() + "IP:" + Program.hostip, Program.username);
                    #endregion
                    MessageBox.Show("" + ex.ToString());
                    return;
                }
            }
            else         //修改
            {
                try
                {
                    int j = tjdjBiz.TjJkzSaveAs(str_jkzbh, str_jkzbh, str_tjbh, str_tjcs, str_xm, str_nl, str_xb, Program.yljgmc, str_bfrq, Program.userid, cmbHy.Text.Trim(), cmbCylx.Text.Trim(), str_bfrq, Convert.ToDateTime(str_bfrq).AddYears(Convert.ToInt16(txt_yxq.Text.Trim())).ToString("yyyy-MM-dd"), txtHjd.Text.Trim(), txtXjdz.Text.Trim(), txtJdhdw.Text.Trim());
                    if (j > 0)
                    {
                        MessageBox.Show("保存成功!", "提示");
                        #region 日志记录
                        loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上修改" + str_tjbh + "的健康证信息成功!IP:" + Program.hostip, Program.username);
                        #endregion
                        btnSearch_Click(null, null);
                        Init();
                    }
                }
                catch (Exception ex)
                {
                    #region 日志记录
                    loginbiz.WriteLogErr(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上修改" + str_tjbh + "的健康证信息失败,原因:" + ex.ToString() + "IP:" + Program.hostip, Program.username);
                    #endregion
                    MessageBox.Show("" + ex.ToString());
                    return;
                }
            }
            #endregion
        }
示例#11
0
        /// <summary>
        /// 批量导入按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_input_Click(object sender, EventArgs e)
        {
            if (!Check_DGV_Select())
            {
                MessageBox.Show("请选择需要导入的人员名单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (txt_tjdw.Text.Trim() == "")
            {
                MessageBox.Show("请选择需要导入单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = bt_tjdw;
                return;
            }
            if (object.Equals(null, cmb_fz.SelectedValue))
            {
                MessageBox.Show("请选择分组!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_fz;
                return;
            }
            if (object.Equals(null, cmb_ywlx.SelectedValue))
            {
                MessageBox.Show("请选择体检业务类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = bt_tjdw;
                return;
            }
            string str_tjrq = dtp_tjrq.Value.ToString("yyyy-MM-dd");

            if (Convert.ToDateTime(str_tjrq) > Convert.ToDateTime(Program.sys_jzzcrq))
            {
                MessageBox.Show("系统使用非法,程序将自动关闭,请联系销售人员:!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Program.sfzc = false;
                main.Form_reg frm_reg = new PEIS.main.Form_reg();
                frm_reg.ShowDialog();
            }

            StringBuilder gzmcs = new StringBuilder();

            foreach (DataGridViewRow dgr in dgv_excel.Rows)
            {
                string str_dwbh = txt_tjdw.Tag.ToString().Trim();
                if (str_dwbh.Length > 4)
                {
                    str_dwbh = str_dwbh.Substring(0, 4);                     //单位编号
                }
                //string str_bmbh = txt_tjdw.Tag.ToString().Trim();
                //if (str_bmbh.Length == 4) str_bmbh = "";
                string str_fzbh = cmb_fz.SelectedValue.ToString().Trim();//分组编号

                if (Convert.ToBoolean(dgr.Cells["selected"].Value))
                {
                    string str_xm   = dgr.Cells["xm"].Value.ToString().Trim();
                    string str_tjbh = "";
                    string str_tjcs = "";
                    //只检查姓名重复,暂不检查身份证重复的情况
                    DataTable dt_tjdjb = tjglbiz.Get_TJ_TJDJB_XM(str_xm, str_dwbh);
                    if (dt_tjdjb.Rows.Count > 0)
                    {
                        Form_tmqr frm = new Form_tmqr(dt_tjdjb);
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            string str_retrun = frm.str_return;
                            if (str_retrun == "2")//同一人
                            {
                                str_tjbh = frm.str_tjbh;
                                str_tjcs = Convert.ToString(Convert.ToInt32(frm.str_tjcs) + 1);
                            }
                            if (str_retrun == "0")//取消
                            {
                                continue;
                            }
                        }
                    }
                    if (str_tjbh == "")
                    {
                        str_tjbh = xtbiz.GetHmz("tjbh", 1);
                        str_tjcs = "1";
                    }

                    string str_xb = dgr.Cells["xb"].Value.ToString().Trim();
                    str_xb = xtbiz.Get_Xtzd_Bzdm("1", str_xb);                   //性别
                    string str_csrq = dgr.Cells["csrq"].Value.ToString().Trim(); //出生
                    //string str_nl = dgr.Cells["nl"].Value.ToString().Trim();//年龄
                    if (!str_csrq.Contains("-"))
                    {
                        string s1 = str_csrq.Substring(0, 4);
                        string s2 = str_csrq.Substring(4, 2);
                        string s3 = str_csrq.Substring(6, 2);
                        str_csrq = s1 + "-" + s2 + "-" + s3;
                    }
                    //处理出生日期和年龄的一致性 by zhz
                    //if (str_csrq == "") str_csrq = xtbiz.GetServerDate().AddYears(-Convert.ToInt32(str_nl)).ToString();
                    string str_nl = Convert.ToString(xtbiz.GetServerDate().Year - Convert.ToDateTime(str_csrq).Year);

                    //string str_hyzk = dgr.Cells["hyzk"].Value.ToString().Trim();
                    //str_hyzk = xtbiz.Get_Xtzd_Bzdm("12", str_hyzk);//婚姻状况
                    //string str_sykh = dgr.Cells["sykh"].Value.ToString().Trim();//索引
                    //string str_mz = dgr.Cells["mz"].Value.ToString().Trim();
                    //str_mz = xtbiz.Get_Xtzd_Bzdm("2", str_mz);//民族
                    string str_sfzh = dgr.Cells["sfzh"].Value.ToString().Trim();//身份证
                    //string str_rylb = dgr.Cells["rylb"].Value.ToString().Trim();
                    //str_rylb = xtbiz.Get_Xtzd_Bzdm("8", str_rylb);//人员类型
                    //string str_phone = dgr.Cells["phone"].Value.ToString().Trim();
                    string str_mobile = dgr.Cells["mobile"].Value.ToString().Trim();
                    //string str_address = dgr.Cells["lxdz"].Value.ToString().Trim();
                    //string whcd = dgr.Cells["whcd"].Value.ToString().Trim();
                    string gzmc = dgr.Cells["gz"].Value.ToString().Trim();
                    string gz   = xtbiz.Get_Xtzd_Bzdm("19", gzmc);               //获取工种
                    //whcd = xtbiz.Get_Xtzd_Bzdm("18", whcd);//获取文化程度
                    string str_whys = dgr.Cells["whys"].Value.ToString().Trim(); //危害因素
                    str_whys = xtbiz.Get_Xtzd_Bzdm("20", str_whys);              //危害因素
                    //str_rylb = xtbiz.Get_Xtzd_Bzdm("8", str_rylb);//人员类型
                    //string sszl = dgr.Cells["sszl"].Value.ToString().Trim();//所属证类
                    //string bzhy = dgr.Cells["bzhy"].Value.ToString().Trim();//办证行业
                    //string gl = dgr.Cells["zgl"].Value.ToString().Trim();//总工龄
                    string jhgl = dgr.Cells["jhgl"].Value.ToString().Trim(); //接害工龄
                    //string str_gh = dgr.Cells["gh"].Value.ToString().Trim();//工号
                    string dw = dgr.Cells["dw"].Value.ToString().Trim();     //单位
                    //string str_bmbh = dgr.Cells["bm"].Value.ToString().Trim();//部门
                    string str_bmbh = txt_tjdw.Tag.ToString().Trim();
                    if (str_bmbh.Length == 4)
                    {
                        str_bmbh = "";                      //不确定部门是多少
                    }
                    #region 危害因素必须录入参数控制
                    if (xtbiz.GetXtCsz("pldjwhyslbpd") == "1") //批量登记危害因素是否判断
                    {
                        if (str_whys == "")
                        {
                            MessageBox.Show("没找到对应的危害因素", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                    }
                    #endregion

                    #region 人员类别必须录入参数控制
                    //if (xtbiz.GetXtCsz("pldjrylbpd") == "1") //批量登记人员类别是否判断
                    //{
                    //    if (str_rylb == "")
                    //    {
                    //        MessageBox.Show("没找到对应的人员类别", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //        return;
                    //    }
                    //}
                    #endregion

                    #region 工种必须录入参数控制
                    if (xtbiz.GetXtCsz("pldjgzpd") == "1") //批量登记工种是否判断
                    {
                        if (gz == "")
                        {
                            MessageBox.Show("没找到对应的工种:" + gzmcs.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                    }
                    #endregion
                    string str_djlsh = "";
                    string str_djrq  = xtbiz.GetServerDate().ToString();

                    if (xtbiz.GetXtCsz("djlshgz") == "2")  //特殊规则YYMMDD+5位
                    {
                        str_djlsh = xtbiz.GetHmz("djlsh", 1);
                    }
                    else
                    {
                        str_djlsh = tjdjbiz.Get_proc_get_djlsh(str_tjrq, Program.userid);
                    }

                    string str_ywlx = cmb_ywlx.SelectedValue.ToString().Trim();

                    //string sfbz = dgr.Cells["sfbz"].Value.ToString().Trim();
                    //if (sfbz == "是")
                    //{
                    //    str_sfbz = "1";
                    //}
                    //else
                    //{
                    //    str_sfbz = "0";
                    //}

                    tjdjBiz tjdjbiz1 = new tjdjBiz();
                    //tjdjbiz1.str_Insert_TJ_TJDJB(str_tjbh, str_tjcs, str_tjrq, str_djrq, str_xm, str_xb, str_csrq, str_nl, str_hyzk, str_sykh, str_mz, str_sfzh, str_rylb,
                    //    "", str_mobile, str_address, str_ywlx, str_djlsh, str_dwbh, str_bmbh, str_fzbh, "", "0", Program.userid, "2",whcd,gz,str_whys,gl,str_sfbz,sszl,bzhy,jhgl);
                    tjdjbiz1.str_Insert_TJ_TJDJB(str_tjbh, str_tjcs, str_tjrq, str_djrq, str_xm, str_xb, str_csrq, str_nl, "", "", "", str_sfzh, "",
                                                 "", str_mobile, "", str_ywlx, str_djlsh, str_dwbh, str_bmbh, str_fzbh, "", "0", Program.userid, "2", "", gz, str_whys, "", str_sfbz, "", "", jhgl);
                    DataTable dt = null;
                    if (str_dwbh == "9999")//个体体检
                    {
                        dt = ywszbiz.Get_tj_tc_dt(str_fzbh);
                    }
                    else
                    {
                        dt = tjglbiz.Get_tj_dwfz_dt(str_fzbh);
                    }

                    int flag = 0;//如果不需要x线号  值为0,普通x线号值为1,高仟伏x线号值为2

                    foreach (DataRow dr in dt.Rows)
                    {
                        if (tjglbiz.CheckSex(dr["zhxm"].ToString().Trim(), str_xb) == 0)
                        {
                            MessageBox.Show("所选择的项目【编号:" + dr["zhxm"].ToString().Trim() + "】存在与性别不匹配,或者组合项目明细为空,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        DataTable dt_tj_zhxm_hd = tjglbiz.Get_tj_zhxm_hd(dr["zhxm"].ToString().Trim());
                        string    str_xh        = xtbiz.GetHmz("tjjlbxh", 1);//体检记录本序号
                        string    str_lxbh      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                        string    str_tjxmbh    = dt_tj_zhxm_hd.Rows[0]["bh"].ToString().Trim();
                        string    str_xmdj      = dt_tj_zhxm_hd.Rows[0]["dj"].ToString().Trim();
                        string    str_zxks      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                        string    str_xmlx      = dt_tj_zhxm_hd.Rows[0]["jcjylx"].ToString().Trim();
                        string    str_sflb      = dt_tj_zhxm_hd.Rows[0]["sflb"].ToString().Trim();

                        tjdjbiz1.str_Insert_tj_tjjlb(str_xh, str_tjbh, str_tjcs, str_lxbh, str_tjrq, str_tjxmbh, str_xmdj, "0", "1", str_sflb, str_zxks, str_xmlx);

                        //生成x线号*****************************************************

                        //获取套餐里是否有x光相关的东西

                        /////////*******************************************************88888
                        string str_zhxm = dr["zhxm"].ToString().Trim();
                        string str_tjmc = dr["mc"].ToString().Trim();

                        if (tjdjbiz1.IsNeedGfq(str_zhxm))
                        {
                            flag = 2;
                        }
                        if (flag == 0 && tjdjbiz1.NeedXhh(str_zhxm))
                        {
                            flag = 1;
                        }
                    }
                    if (flag == 2)
                    {
                        tjdjbiz1.saveXxh(str_tjbh, str_sfzh, true);
                    }
                    if (flag == 1)
                    {
                        tjdjbiz1.saveXxh(str_tjbh, str_sfzh, false);
                    }

                    if (str_ywlx.Trim() == "01")
                    {
                        //tjdjbiz1.str_Insert_TJ_ZYB_RYXX(str_tjbh, str_tjcs, str_xm, str_xb, str_sfzh, str_csrq, txt_tjdw.Text.Trim(), str_mobile, str_gh, "", dtp_tjrq.Value.ToString("yyyy-MM-dd"), str_rylb,
                        //"", "", dtp_tjrq.Value.ToString("yyyy-MM-dd"), "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", str_address, gz, "", "", "", str_mz, str_hyzk, gl, jhgl, str_whys, "");
                        tjdjbiz1.str_Insert_TJ_ZYB_RYXX(str_tjbh, str_tjcs, str_xm, str_xb, str_sfzh, str_csrq, txt_tjdw.Text.Trim(), str_mobile, "", "", dtp_tjrq.Value.ToString("yyyy-MM-dd"), "",
                                                        "", "", dtp_tjrq.Value.ToString("yyyy-MM-dd"), "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", gz, "", "", "", "", "", "", jhgl, str_whys, "");
                    }
                    tjdjbiz1.Exec_ArryList();//登记表执行成功后在执行记录表
                }
            }
            MessageBox.Show("批量导入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ckb_all.Checked = false;
            ckb_all_CheckedChanged(null, null);
        }
示例#12
0
        private void bt_input_Click(object sender, EventArgs e)
        {
            if (!Check_DGV_Select())
            {
                MessageBox.Show("请选择需要导入的人员名单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (txt_tjdw.Text.Trim() == "")
            {
                MessageBox.Show("请选择需要导入单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = bt_tjdw;
                return;
            }
            if (object.Equals(null, cmb_fz.SelectedValue))
            {
                MessageBox.Show("请选择分组!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_fz;
                return;
            }
            if (object.Equals(null, cmb_ywlx.SelectedValue))
            {
                MessageBox.Show("请选择体检业务类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = bt_tjdw;
                return;
            }
            string str_tjrq = dtp_tjrq.Value.ToString("yyyy-MM-dd");

            foreach (DataGridViewRow dgr in dgv_excel.Rows)
            {
                string str_dwbh = txt_tjdw.Tag.ToString().Trim();
                if (str_dwbh.Length > 4)
                {
                    str_dwbh = str_dwbh.Substring(0, 4);                     //单位编号
                }
                string str_bmbh = txt_tjdw.Tag.ToString().Trim();
                if (str_bmbh.Length == 4)
                {
                    str_bmbh = "";
                }
                string str_fzbh = cmb_fz.SelectedValue.ToString().Trim();//分组编号

                if (Convert.ToBoolean(dgr.Cells["selected"].Value))
                {
                    string str_xm   = dgr.Cells["xm"].Value.ToString().Trim();
                    string str_tjbh = "";
                    string str_tjcs = "";
                    //只检查姓名重复,暂不检查身份证重复的情况
                    string dwbh = txt_tjdw.Tag.ToString().Trim();
                    if (str_dwbh.Length > 4)
                    {
                        str_dwbh = str_dwbh.Substring(0, 4);                     //单位编号
                    }
                    DataTable dt_tjdjb = tjglbiz.Get_TJ_TJDJB_XM(str_xm, dwbh);
                    if (dt_tjdjb.Rows.Count > 0)
                    {
                        Form_tmqr frm = new Form_tmqr(dt_tjdjb);
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            string str_retrun = frm.str_return;
                            if (str_retrun == "2")//同一人
                            {
                                str_tjbh = frm.str_tjbh;
                                str_tjcs = Convert.ToString(Convert.ToInt32(frm.str_tjcs) + 1);
                            }
                            if (str_retrun == "0")//取消
                            {
                                continue;
                            }
                        }
                    }
                    if (str_tjbh == "")
                    {
                        str_tjbh = xtbiz.GetHmz("tjbh", 1);
                        str_tjcs = "1";
                    }

                    string str_xb = dgr.Cells["xb"].Value.ToString().Trim();
                    str_xb = xtbiz.Get_Xtzd_Bzdm("1", str_xb);//性别
                    string str_csrq = dgr.Cells["csrq"].Value.ToString().Trim();
                    string str_nl   = dgr.Cells["nl"].Value.ToString().Trim();
                    try//处理出生日期和年龄的一致性
                    {
                        if (str_csrq == "")
                        {
                            str_csrq = xtbiz.GetServerDate().AddYears(-Convert.ToInt32(str_nl)).ToString();
                        }
                        if (str_nl == "")
                        {
                            str_nl = Convert.ToString(xtbiz.GetServerDate().Year - Convert.ToDateTime(str_csrq).Year);
                        }
                    }
                    catch
                    {
                    }

                    string str_hyzk = dgr.Cells["hyzk"].Value.ToString().Trim();
                    str_hyzk = xtbiz.Get_Xtzd_Bzdm("12", str_hyzk);//婚姻状况
                    string str_sykh = dgr.Cells["sykh"].Value == null ? "" : dgr.Cells["sykh"].Value.ToString().Trim();
                    string str_mz   = dgr.Cells["mz"].Value.ToString().Trim();
                    str_mz = xtbiz.Get_Xtzd_Bzdm("2", str_mz);//民族
                    string str_sfzh = dgr.Cells["sfzh"].Value.ToString().Trim();
                    string str_rylb = dgr.Cells["rylb"].Value.ToString().Trim();
                    str_rylb = xtbiz.Get_Xtzd_Bzdm("8", str_rylb);//人员类型
                    string str_phone   = dgr.Cells["phone"].Value.ToString().Trim();
                    string str_mobile  = dgr.Cells["mobile"].Value.ToString().Trim();
                    string str_address = dgr.Cells["lxdz"].Value.ToString().Trim();

                    string str_djrq  = xtbiz.GetServerDate().ToString();
                    string str_djlsh = "";
                    if (xtbiz.GetXtCsz("djlshgz") == "2")  //特殊规则YYMMDD+5位
                    {
                        str_djlsh = xtbiz.GetHmz("djlsh", 1);
                    }
                    else
                    {
                        str_djlsh = tjdjbiz.Get_proc_get_djlsh(str_tjrq, Program.userid);
                    }


                    string str_tjlb = cmb_ywlx.SelectedValue.ToString().Trim();
                    string gz       = dgr.Cells["gz"].Value == null ? "" : dgr.Cells["gz"].Value.ToString().Trim();
                    string gzbh     = xtbiz.Get_Xtzd_Bzdm("19", gz);

                    if (str_rylb == "")
                    {
                        MessageBox.Show("没找到对应的人员类别", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    //if (gz == "")
                    //{
                    //    MessageBox.Show("没找到对应的工种", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //    return;
                    //}
                    tjdjBiz tjdjbiz1 = new tjdjBiz();
                    tjdjbiz1.str_Insert_TJ_TJDJB(str_tjbh, str_tjcs, str_tjrq, str_djrq, str_xm, str_xb, str_csrq, str_nl, str_hyzk, str_sykh, str_mz, str_sfzh, str_rylb,
                                                 str_phone, str_mobile, str_address, str_tjlb, str_djlsh, str_dwbh, str_bmbh, str_fzbh, "", "0", Program.userid, "2", "", gz, "", "", str_sfbz, "", "", "");

                    DataTable dt = null;
                    if (str_dwbh == "9999")//个体体检
                    {
                        dt = ywszbiz.Get_tj_tc_dt(str_fzbh);
                    }
                    else
                    {
                        dt = tjglbiz.Get_tj_dwfz_dt(str_fzbh);
                    }

                    int flag = 0;
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (tjglbiz.CheckSex(dr["zhxm"].ToString().Trim(), str_xb) == 0)
                        {
                            MessageBox.Show("所选择的项目【编号:" + dr["zhxm"].ToString().Trim() + "】存在与性别不匹配,或者组合项目明细为空,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        DataTable dt_tj_zhxm_hd = tjglbiz.Get_tj_zhxm_hd(dr["zhxm"].ToString().Trim());
                        string    str_xh        = xtbiz.GetHmz("tjjlbxh", 1);//体检记录本序号
                        string    str_lxbh      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                        string    str_tjxmbh    = dt_tj_zhxm_hd.Rows[0]["bh"].ToString().Trim();
                        string    str_xmdj      = dt_tj_zhxm_hd.Rows[0]["dj"].ToString().Trim();
                        string    str_zxks      = dt_tj_zhxm_hd.Rows[0]["tjlx"].ToString().Trim();
                        string    str_xmlx      = dt_tj_zhxm_hd.Rows[0]["jcjylx"].ToString().Trim();
                        string    str_sflb      = dt_tj_zhxm_hd.Rows[0]["sflb"].ToString().Trim();
                        tjdjbiz1.str_Insert_tj_tjjlb(str_xh, str_tjbh, str_tjcs, str_lxbh, str_tjrq, str_tjxmbh, str_xmdj, "0", "1", str_sflb, str_zxks, str_xmlx);

                        string str_zhxm = dr["zhxm"].ToString().Trim();
                        string str_tjmc = dr["mc"].ToString().Trim();

                        if (tjdjbiz1.IsNeedGfq(str_zhxm))
                        {
                            flag = 2;
                        }
                        if (flag == 0 && tjdjbiz1.NeedXhh(str_zhxm))
                        {
                            flag = 1;
                        }
                    }

                    if (flag == 2)
                    {
                        tjdjbiz1.saveXxh(str_tjbh, str_sfzh, true);
                    }
                    if (flag == 1)
                    {
                        tjdjbiz1.saveXxh(str_tjbh, str_sfzh, false);
                    }

                    tjdjbiz1.Exec_ArryList();//登记表执行成功后在执行记录表
                }
            }
            MessageBox.Show("批量导入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            ckb_all.Checked = false;
            ckb_all_CheckedChanged(null, null);
        }
示例#13
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
        }
示例#14
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            string str_yxbz   = "1"; //启用标志
            string str_sfxybb = "0"; //是否需要标本
            string str_lclx   = "";  //临床类型
            string str_bblx   = "";  //标本类型
            string str_jyjclx = "";  //检验检查类型
            string str_sflb   = "";  //收费类别

            if (rb_yxbz1.Checked)
            {
                str_yxbz = "1";                  //启用
            }
            if (rb_yxbz2.Checked)
            {
                str_yxbz = "0";                  //停用
            }
            if (rb_sfxybb1.Checked)
            {
                str_sfxybb = "1";
            }
            if (rb_sfxybb2.Checked)
            {
                str_sfxybb = "0";
            }

            if (object.Equals(null, cmb_lclx.SelectedValue))
            {
                str_lclx = "";
            }
            else
            {
                str_lclx = cmb_lclx.SelectedValue.ToString().Trim();
            }

            if (object.Equals(null, cmb_bblx.SelectedValue))
            {
                str_bblx = "";
            }
            else
            {
                str_bblx = cmb_bblx.SelectedValue.ToString().Trim();
            }
            if (txt_mc.Text.Trim() == "")
            {
                MessageBox.Show("请填写组合名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_mc;
                return;
            }
            if (object.Equals(null, cmb_jyjclx.SelectedValue))
            {
                MessageBox.Show("请选择检查类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = cmb_jyjclx;
                return;
            }
            else
            {
                str_jyjclx = cmb_jyjclx.SelectedValue.ToString().Trim();
            }

            if (object.Equals(null, cmb_sflb.SelectedValue))
            {
                str_sflb = "";
            }
            else
            {
                str_sflb = cmb_sflb.SelectedValue.ToString().Trim();
            }

            if (str_state == "Update")
            {
                if (txt_bh.Text.Trim() == "")
                {
                    return;
                }
                ywszbiz.Update_tj_zhxm_hd(cmb_ksmc.SelectedValue.ToString().Trim(), str_yxbz, txt_bh.Text.Trim(), txt_disp_order.Text.Trim(), txt_mc.Text.Trim(),
                                          txt_dj.Text.Trim(), str_lclx, txt_zdym.Text.Trim(), txt_pyjm.Text.Trim(), txt_wbjm.Text.Trim(), txt_lcyy.Text.Trim(), txt_tsxx.Text.Trim(),
                                          txt_zcxj.Text.Trim(), str_sfxybb, str_bblx, str_jyjclx, str_sflb);
                MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (rb_yxbz2.Checked)
                {
                    tv_tjlxb.SelectedNode.ForeColor          = Color.Red;
                    tv_tjlxb.SelectedNode.ImageIndex         = 3;
                    tv_tjlxb.SelectedNode.SelectedImageIndex = 3;
                }
                else
                {
                    tv_tjlxb.SelectedNode.ForeColor          = tv_tjlxb.Nodes[0].ForeColor;//停用
                    tv_tjlxb.SelectedNode.ImageIndex         = 2;
                    tv_tjlxb.SelectedNode.SelectedImageIndex = 2;
                }
                tv_tjlxb.SelectedNode.Text = txt_mc.Text.Trim();
                return;
            }

            if (str_state == "Insert")
            {
                if (object.Equals(cmb_ksmc.SelectedValue, null))
                {
                    return;
                }

                //txt_bh.Text = ywszbiz.Get_proc_get_tjzhxmbh(cmb_ksmc.SelectedValue.ToString().Trim());//获取体检项目的编号
                txt_bh.Text = xtbiz.GetHmz("tjzhxmid", 1);
                if (txt_disp_order.Text == "")
                {
                    txt_disp_order.Text = txt_bh.Text;
                }

                ywszbiz.Insert_tj_zhxm_hd(cmb_ksmc.SelectedValue.ToString().Trim(), str_yxbz, txt_bh.Text.Trim(), txt_disp_order.Text.Trim(), txt_mc.Text.Trim(),
                                          txt_dj.Text.Trim(), str_lclx, txt_zdym.Text.Trim(), txt_pyjm.Text.Trim(), txt_wbjm.Text.Trim(), txt_lcyy.Text.Trim(), txt_tsxx.Text.Trim(),
                                          txt_zcxj.Text.Trim(), str_sfxybb, str_bblx, str_jyjclx, str_sflb);

                MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                str_state = "Update";

                TreeNode node = new TreeNode(txt_mc.Text.Trim());
                node.Tag = txt_bh.Text.Trim();
                if (rb_yxbz2.Checked)
                {
                    node.ForeColor = Color.Red;                  //停用
                }
                tv_tjlxb.SelectedNode.Parent.Nodes.Add(node);
                cmb_ksmc.Enabled = false;
                return;
            }
        }