Exemplo n.º 1
0
        private void lv_fz_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = lv_fz.GetItemAt(e.X, e.Y);

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

            DataTable dt       = tjglbiz.Get_tj_dwfz_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();
        }
Exemplo n.º 2
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  = "";
        }
Exemplo n.º 3
0
        private void bt_delete_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_djlsh = dgr.Cells["djlsh"].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;
                    }
                    tjdjbiz1.str_Delete_tj_tjjlb(str_tjbh, str_tjcs, txt_zhxm.Tag.ToString().Trim());
                }
            }
            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  = "";
        }
Exemplo n.º 4
0
        private void bt_save_Click(object sender, EventArgs e)
        {
            //tj_mrfz_all();
            //return;
            if (str_dwbh == "")
            {
                return;                //没有选择节点
            }
            if (txt_fzmc.Text.Trim() == "")
            {
                MessageBox.Show("请填写分组名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_fzmc;
                return;
            }

            //if (lv_tjxm.Items.Count <= 0)
            //{
            //    MessageBox.Show("请选择体检项目或套餐后再保存!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}

            if (str_fzbh == "")//获取分组编号
            {
                str_fzbh      = tjglbiz.Get_proc_get_tjdwfzbh(str_dwbh);
                txt_fzbh.Text = str_fzbh;
            }
            tjdjBiz tjblbiz1 = new tjdjBiz();

            tjblbiz1.str_Delete_TJ_DWFZ_HD(str_fzbh, str_dwbh);
            tjblbiz1.str_Insert_TJ_DWFZ_HD(str_fzbh, str_dwbh, txt_fzmc.Text.Trim(), cmb_xb.SelectedValue.ToString().Trim(), txt_zw.Text.Trim(), txt_zc.Text.Trim());
            foreach (ListViewItem item in lv_tjxm.Items)
            {
                string aa = item.Tag.ToString().Trim();
                string bb = item.Text.ToString().Trim();
                tjblbiz1.str_Insert_TJ_DWFZ_DT(str_fzbh, str_dwbh, aa);
            }
            tjblbiz1.Exec_ArryList();
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DataBind();
            tv_tjdw.ExpandAll();
        }
Exemplo n.º 5
0
        private void lv_uncheckxm_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = lv_uncheckxm.GetItemAt(e.X, e.Y);

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

            if (tjglbiz.CheckSex(item.Tag.ToString().Trim(), str_xb) == 0)
            {
                MessageBox.Show("所选择的项目【编号:" + item.Tag.ToString().Trim() + "】存在与性别不匹配,或者组合项目明细为空,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DataTable dt_tj_zhxm_hd = tjglbiz.Get_tj_zhxm_hd(item.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();

            tjdjBiz tjglbiz1 = new tjdjBiz();

            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);
            tjglbiz1.Exec_ArryList();

            ListViewItem item1 = new ListViewItem();

            item1.Tag  = item.Tag;
            item1.Text = item.Text;
            lv_checkxm.Items.Add(item1);
            lv_uncheckxm.Items.Remove(item);
        }
Exemplo n.º 6
0
        private void tj_mrfz(string str_dwbh)// by zhz
        {
            //read
            if (str_dwbh == "")
            {
                return;                //没有选择节点
            }
            ywszBiz   ywszbiz = new ywszBiz();
            DataTable dt_tjtc = ywszbiz.Get_tj_tc_hd();

            for (int i = 0; i < dt_tjtc.Rows.Count; i++)
            {
                DataRow   dr_tc       = dt_tjtc.Rows[i];              //体检项目
                string    str_bh      = dr_tc["bh"].ToString().Trim();
                DataTable dt_tj_tc_dc = ywszbiz.Get_tj_tc_dt(str_bh); //体检内容

                //add
                txt_fzbh.Text = dr_tc["bh"].ToString().Trim();
                txt_fzmc.Text = dr_tc["mc"].ToString().Trim();
                //cmb_xb.SelectedValue = dr_tc["xb"].ToString().Trim();
                txt_zc.Text = "";
                txt_zw.Text = "";

                str_fzbh = tjglbiz.Get_proc_get_tjdwfzbh(str_dwbh);
                tjdjBiz tjblbiz1 = new tjdjBiz();
                tjblbiz1.str_Delete_TJ_DWFZ_HD(str_fzbh, str_dwbh);
                tjblbiz1.str_Insert_TJ_DWFZ_HD(str_fzbh, str_dwbh, txt_fzmc.Text.Trim(), "1", txt_zw.Text.Trim(), txt_zc.Text.Trim());//1 是男士
                foreach (DataRow dr_dc in dt_tj_tc_dc.Rows)
                {
                    string aa = dr_dc["zhxm"].ToString().Trim();
                    string bb = dr_dc["mc"].ToString().Trim();
                    tjblbiz1.str_Insert_TJ_DWFZ_DT(str_fzbh, str_dwbh, aa);
                }
                tjblbiz1.Exec_ArryList();
            }
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
        private void btn_bztf_Click(object sender, EventArgs e)
        {
            #region 办证退费输入检查
            if (str_tjbh_bz == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }
            if (str_tjcs_bz == "")
            {
                MessageBox.Show("请选择一条人员信息!", "提示");
                return;
            }
            if (txt_tfyy_bz.Text.Trim() == "")
            {
                MessageBox.Show("请输入办证退费原因!", "提示");
                txt_tfyy_bz.Focus();
                return;
            }
            if (sfjlbz_bz == "0")
            {
                MessageBox.Show("该记录没有收费,不需要退费!", "提示");
                return;
            }
            #endregion

            DialogResult dlg = MessageBox.Show("确定要退费吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
            if (dlg == DialogResult.No)
            {
                return;
            }

            #region 办证退费金额检查
            //实际退金额
            DataTable dttf = tjdjbiz.GetSsje(sfjlbz_bz, str_tjbh_bz, str_tjcs_bz);
            if (dttf.Rows.Count == 0)
            {
                return;
            }
            string stje = dttf.Rows[0]["ssje"].ToString();
            string yhlx = dttf.Rows[0]["yhlx"].ToString();
            string yhxx = dttf.Rows[0]["yhxx"].ToString();
            #endregion

            #region 退费
            //未收费时,退费功能不可用
            if (Convert.ToInt16(sfjlbz_bz) > 0)
            {
                //退费单号
                try
                {
                    tjdjBiz tjdjbiz2 = new tjdjBiz();
                    string  tfdh     = xtbiz.GetHmz("tj_tfdh", 1);
                    tjdjbiz2.TjTf(tfdh, Program.userid, Convert.ToDecimal(stje), txt_tfyy_bz.Text.Trim(), sfjlbz_bz);

                    string sfh = xtbiz.GetHmz("tj_sjh", 1);
                    tjdjbiz2.TjSf(sfh, str_tjbh_bz, str_tjcs_bz, Program.userid, -Convert.ToDecimal(stje), -Convert.ToDecimal(stje), Convert.ToInt16(yhlx), 0, sfjlbz_bz, txt_tfyy.Text.Trim());
                    tjdjbiz2.UpdateSfb(sfjlbz_bz, str_tjbh_bz, str_tjcs_bz, sfh);
                    int i = tjdjbiz2.Exec_ArryList();
                    //if (i > 0)
                    //{
                    MessageBox.Show("退费成功!金额" + stje.ToString() + "请收回原发票!", "提示");
                    #region 日志记录
                    loginbiz.WriteLog(this.Name.Trim(), "【" + Program.username + "】" + "在电脑【" + ma.HostName() + "】上退补证费成功,退费单号是:" + tfdh + ",IP:" + Program.hostip, Program.username);
                    #endregion
                    button1_Click(null, null);
                    //}
                }
                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
        }