コード例 #1
0
ファイル: Form_dwdj.cs プロジェクト: wangronghua/PEIS_Autoz
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (txt_mc.Text.Trim() == "")
            {
                MessageBox.Show("请填写单位名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_mc;
                return;
            }
            if (txt_bh.Text.Trim() == "")
            {
                str_bh = tjglbiz.Get_proc_get_tjdwbh(str_bh);
                if (str_bh == "")//如果为空,说明选中的是第一级
                {
                    str_bh = tjglbiz.GetDwbh();
                }
                txt_bh.Text = str_bh;
            }
            string str_qybz = "1";

            if (!ckb_qybz.Checked)
            {
                str_qybz = "0";
            }
            string str_qyxz = "";

            if (object.Equals(null, cmb_qyxz.SelectedValue))
            {
                str_qyxz = "";
            }
            else
            {
                str_qyxz = cmb_qyxz.SelectedValue.ToString().Trim();
            }
            tjglbiz.Insert_tj_dw(str_bh, str_qybz, txt_mc.Text.Trim(), txt_pyjm.Text.Trim(), txt_wbjm.Text.Trim(), txt_dwfzr.Text.Trim(), txt_lxdh.Text.Trim(),
                                 txt_czdh.Text.Trim(), txt_yzbh.Text.Trim(), txt_lxdz.Text.Trim(), txt_ywyy.Text.Trim(), txt_yhzh.Text.Trim(), str_qyxz, txt_jzrs.Text.Trim(),
                                 txt_bz.Text.Trim(), cmbJjlx.Text.Trim(), cmbHy.Text.Trim(), cmbQygm.Text.Trim(), txtScgrs.Text.Trim(), txtJcydzyrs.Text.Trim(), cmbLx.Text.Trim());
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            DataBind();
            tv_tjdw.ExpandAll();
        }