예제 #1
0
        private void txtDy_Leave(object sender, EventArgs e)
        {
            string dy = txtDy.Text.Trim();

            if (dy == "")
            {
                return;
            }
            dy = comn.CharConverter(dy);
            if (comn.DoubleYz(dy) == -1)
            {
                MessageBox.Show("数字格式错误!");
                this.ActiveControl = txtDy;
                txtDy.SelectAll();
                return;
            }
            txtDy.Text = dy;
        }
예제 #2
0
        void LoadDjxx()
        {
            string djh = txtDjh.Text.Trim();

            djh         = comn.CharConverter(djh);
            djh         = ChangeNum(djh);
            txtDjh.Text = djh;
            dt          = new DataTable();
            dt          = jyjkBiz.GetDjxx(djh, comn.CharConverter(txtTjbh.Text.Trim()));
            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("登记流水号【" + djh + "】无效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txtDjh;
                txtDjh.SelectAll();
                return;
            }
            string jyjx = cmbJyyq.SelectedValue.ToString().Trim();
            string djbh = dt.Rows[0]["djlsh"].ToString().Trim();

            cmbFb.SelectedIndex = 2;
            if (jyjkBiz.HasExist(jyjx, djbh))//如果已存在,将光标指向该项  PEIS.jyjk.Form_jysjlr
            {
                LoadDgvJydj(jyjx, "", djbh, cmbFb.SelectedIndex);
                int i = 0;
                for (; i < dgvJydj.Rows.Count; i++)
                {
                    string djlsh2 = dgvJydj.Rows[i].Cells["djlsh"].Value.ToString().Trim();
                    if (djlsh2 == djbh)
                    {
                        break;
                    }
                }
                if (dgvJydj.Rows.Count > 0)
                {
                    dgvJydj.CurrentCell = dgvJydj.Rows[i].Cells[3];
                }
            }
            else//不存在则插入记录
            {
                Jydj jydj = new Jydj();
                jydj.Djlsh = dt.Rows[0]["djlsh"].ToString().Trim();
                jydj.Djrq  = dtpDjrq.Value.ToString();
                jydj.Dwmc  = dt.Rows[0]["dwmc"].ToString().Trim();
                jydj.Jyjx  = jyjx;
                jydj.Nl    = dt.Rows[0]["nl"].ToString().Trim();
                jydj.Rylb  = dt.Rows[0]["rylb"].ToString().Trim();
                jydj.Sfzh  = dt.Rows[0]["sfzh"].ToString().Trim();
                jydj.Tjbh  = dt.Rows[0]["tjbh"].ToString().Trim();
                jydj.Xb    = dt.Rows[0]["xb"].ToString().Trim();
                jydj.Xm    = dt.Rows[0]["xm"].ToString().Trim();
                jydj.Gz    = dt.Rows[0]["gz"].ToString().Trim();
                string czyid = "";
                if (cmbJcys.SelectedIndex != -1)
                {
                    czyid = cmbJcys.SelectedValue.ToString();
                }
                jydj.Jcys = czyid;
                jydj.Shrq = xtBiz.GetDataNow().ToString();
                jydj.Shys = Program.userid;
                jydj.Tcmc = dt.Rows[0]["tcmc"].ToString().Trim().Split('(')[0];

                int count = jyjkBiz.Insert(jydj);
                if (count > 0)
                {
                    LoadDgvJydj(jyjx, dtpDjrq.Value.ToString("yyyy-MM-dd"), "", cmbFb.SelectedIndex);
                }
            }

            string zdtx = xtBiz.GetXtCsz("zdtx");

            if (zdtx == "1" && cmbJyyq.SelectedValue.ToString() == "0002")//目前只有BC5300具备通讯功能
            {
                btnTx_Click(null, null);
            }
        }
예제 #3
0
 private void dgvTjhz_Leave(object sender, EventArgs e)
 {
     dgvTjhz.SelectedCells[0].Value = comn.CharConverter(dgvTjhz.SelectedCells[0].Value.ToString().Trim());
 }
예제 #4
0
 private void txt_bl_Leave(object sender, EventArgs e)
 {
     Common.Common comn = new Common.Common();
     txt_bl.Text = comn.CharConverter(txt_bl.Text.Trim());
 }