Exemplo n.º 1
0
        private void txt_ksjs_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                if (txt_ksjs.Text.Trim() == "")
                {
                    MessageBox.Show("请填写快速检索值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.ActiveControl = txt_ksjs;
                    return;
                }
                DataTable dt = tjjgbiz.Get_TJ_TJDJB(txt_ksjs.Text.Trim());
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows.Count > 1)
                    {
                        Form_ryxz frm = new Form_ryxz(tjdjbiz.Get_TJ_TJDJB_ALL(txt_ksjs.Text.Trim()));
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            str_tjbh    = frm.str_tjbh;
                            str_tjcs    = frm.str_tjcs;
                            str_sumover = frm.str_sumover;
                        }
                    }
                    else
                    {
                        str_tjbh    = dt.Rows[0]["tjbh"].ToString().Trim();
                        str_tjcs    = dt.Rows[0]["tjcs"].ToString().Trim();
                        str_sumover = dt.Rows[0]["sumover"].ToString().Trim();
                    }
                    if (str_sumover == "2")
                    {
                        if (DialogResult.No == MessageBox.Show("该人员已经总检,是否继续查看记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
                        {
                            txt_ksjs.SelectAll();
                            return;
                        }
                    }

                    TJDJB_DataBind(str_tjbh, str_tjcs);
                    TJ_ZYJLMX_DataBind(str_tjbh, str_tjcs);
                    TJ_ZYJL_DataBind(str_tjbh, str_tjcs);
                }
                else
                {
                    MessageBox.Show("没有检索到记录,请检查检索值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txt_ksjs.SelectAll();
                    return;
                }
            }
        }