Exemple #1
0
        /// <summary>
        /// 插入检验登记信息
        /// </summary>
        /// <param name="jydj"></param>
        /// <returns></returns>
        public void Insert(Jydj jydj, List <string> sqls)
        {
            sql = new StringBuilder("insert into jy_jydj(djrq,jyjx,djlsh,tjbh,xm,xb,nl,sfzh,dwmc,rylb) values('");
            sql.Append(jydj.Djrq + "','");
            sql.Append(jydj.Jyjx + "','");
            sql.Append(jydj.Djlsh + "','");
            sql.Append(jydj.Tjbh + "','");
            sql.Append(jydj.Xm + "','");
            sql.Append(jydj.Xb + "','");
            sql.Append(jydj.Nl + "','");
            sql.Append(jydj.Sfzh + "','");
            sql.Append(jydj.Dwmc + "','");
            sql.Append(jydj.Rylb + "')");

            sqls.Add(sql.ToString());
        }
Exemple #2
0
        /// <summary>
        /// 插入检验登记信息
        /// </summary>
        /// <param name="jydj"></param>
        /// <returns></returns>
        public int Insert(Jydj jydj)
        {
            sql = new StringBuilder("insert into jy_jydj(djrq,jyjx,djlsh,tjbh,xm,xb,nl,sfzh,dwmc,jcys,shrq,shys,gz,whys,rylb) values('");
            sql.Append(jydj.Djrq + "','");
            sql.Append(jydj.Jyjx + "','");
            sql.Append(jydj.Djlsh + "','");
            sql.Append(jydj.Tjbh + "','");
            sql.Append(jydj.Xm + "','");
            sql.Append(jydj.Xb + "','");
            sql.Append(jydj.Nl + "','");
            sql.Append(jydj.Sfzh + "','");
            sql.Append(jydj.Dwmc + "','");
            sql.Append(jydj.Jcys + "','");
            sql.Append(jydj.Shrq + "','");
            sql.Append(jydj.Shys + "','");
            sql.Append(jydj.Gz + "','");
            sql.Append(jydj.Tcmc + "','");
            sql.Append(jydj.Rylb + "')");

            return(base.SqlDBAgent.sqlupdate(sql.ToString()));
        }
        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);
            }
        }