Exemplo n.º 1
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            string s_fin_pjlx = string.Empty;
            string s_fin_zch  = string.Empty;
            string s_fin_fph  = string.Empty;

            string s_fpdm = string.Empty;
            string s_fph  = string.Empty;

            //1.输入完整性检查!!!
            if (xtraTabPage1.PageEnabled)
            {
                if (string.IsNullOrEmpty(te_pjlx.Text))
                {
                    te_pjlx.ErrorText = "财政票据类型不能为空!";
                    te_pjlx.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                    te_pjlx.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(te_zch.Text))
                {
                    te_zch.ErrorText = "发票注册号不能为空!";
                    te_zch.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                    te_zch.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(te_fph.Text))
                {
                    te_fph.ErrorText = "财政发票号不能为空!";
                    te_fph.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                    te_fph.Focus();
                    return;
                }
                s_fin_pjlx = te_pjlx.Text;
                s_fin_zch  = te_zch.Text;
                s_fin_fph  = te_fph.Text;
            }
            if (xtraTabPage2.PageEnabled)
            {
                if (string.IsNullOrEmpty(te_tax_code.Text))
                {
                    te_tax_code.ErrorText = "税务发票代码不能为空!";
                    te_tax_code.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                    te_tax_code.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(te_tax_ph.Text))
                {
                    te_tax_ph.ErrorText = "税务发票号不能为空!";
                    te_tax_ph.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                    te_tax_ph.Focus();
                    return;
                }
                s_fpdm = te_tax_code.Text;
                s_fph  = te_tax_ph.Text;
            }

            //2. 补充财政发票日志
            int result = 0;

            if (xtraTabPage1.PageEnabled)
            {
                result = MiscAction.FinReLog(s_fa001, s_fin_pjlx, s_fin_zch, s_fin_fph);
                if (result < 0)
                {
                    return;
                }
                XtraMessageBox.Show("财政发票日志记录成功!", "提示");
            }
            if (xtraTabPage2.PageEnabled)
            {
                result = MiscAction.TaxReLog(s_fa001, s_fpdm, s_fph);
                if (result < 0)
                {
                    return;
                }
                XtraMessageBox.Show("税务发票日志记录成功!", "提示");
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }