示例#1
0
        private void B_ok_Click(object sender, EventArgs e)
        {
            decimal nums;

            if (!decimal.TryParse(comboBox1.Text, out nums))
            {
                MessageBox.Show("请输入正确的缴费年限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (!(bitprice > 0))
            {
                MessageBox.Show("参数传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string fa001 = Tools.GetEntityPK("FA01");
            int    re    = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, Envior.cur_userId);

            if (re > 0)
            {
                dt_rc04.Rows.Clear();
                rc04Adapter.Fill(dt_rc04);

                if (MessageBox.Show("缴费成功!现在打印【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    if (!Envior.canInvoice)
                    {
                        MessageBox.Show("当前用户没有打印发票权限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    if (!Envior.TAX_READY)
                    {
                        MessageBox.Show("金税卡没有打开!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        Frm_taxClientInfo frm_client = new Frm_taxClientInfo();
                        frm_client.swapdata["parent"] = this;
                        frm_client.swapdata["title"]  = FireAction.Get_PassbyName(rc001);
                        if (frm_client.ShowDialog(this) == DialogResult.OK)
                        {
                            InvoiceInfo invClient = this.swapdata["clientinfo"] as InvoiceInfo;

                            //打印发票
                            //PrtServAction.Print_RegisterInvoice(fa001, invClient, this.Handle.ToInt32());
                            PrtServAction.Print_Invoice(fa001, invClient);
                        }
                        frm_client.Dispose();
                    }
                }

                if (MessageBox.Show("现在打印缴费记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    //打印缴费记录
                    PrtServAction.PrtRegisterPayRecord(fa001, this.Handle.ToInt32());
                }
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
示例#2
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            decimal nums;

            if (!decimal.TryParse(comboBox1.Text, out nums))
            {
                XtraMessageBox.Show("请输入正确的缴费年限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (!(bitprice > 0))
            {
                XtraMessageBox.Show("参数传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string cuname = txtEdit_rc003.Text;
            string fa001  = Tools.GetEntityPK("FA01");

            int re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, Envior.cur_userId);

            if (re > 0)
            {
                dt_rc04.Rows.Clear();
                rc04Adapter.Fill(dt_rc04);

                if (XtraMessageBox.Show("缴费成功!现在打印【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    if (FinInvoice.GetCurrentPh() > 0)
                    {
                        if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            FinInvoice.Invoice(fa001);
                        }
                    }
                }

                if (XtraMessageBox.Show("现在打印缴费记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    //打印缴费记录
                    PrtServAction.PrtRegisterPayRecord(fa001, this.Handle.ToInt32());
                }
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
示例#3
0
        /// <summary>
        /// 缴费 过程
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void b_ok_Click(object sender, EventArgs e)
        {
            decimal nums;
            decimal dec_tax_sum = decimal.Zero;

            if (!decimal.TryParse(comboBox1.Text, out nums))
            {
                XtraMessageBox.Show("请输入正确的缴费期限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (!(bitprice > 0))
            {
                XtraMessageBox.Show("参数传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string cuname = txtEdit_rc003.Text;
            string fa001  = Tools.GetEntityPK("FA01");
            int    re     = 0;


            List <string>  itemId_List    = new List <string>();
            List <decimal> itemPrice_List = new List <decimal>();
            List <int>     itemNums_List  = new List <int>();

            if (fpfee > 0)
            {
                foreach (DataRow r in dt_sa01.Rows)
                {
                    itemId_List.Add(r["SA004"].ToString());
                    itemPrice_List.Add(Convert.ToDecimal(r["PRICE"]));
                    itemNums_List.Add(Convert.ToInt32(r["NUMS"]));
                    //计算税票项目金额
                    if (MiscAction.GetItemInvoiceType(r["SA004"].ToString()) == "T")
                    {
                        dec_tax_sum += Convert.ToDecimal(r["SA007"]);
                    }
                }
            }

            if (dec_tax_sum > 0 && !TaxInvoice.ClientIsOnline())
            {
                if (XtraMessageBox.Show("【税神通】客户端不在线!是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }


            if (fpfee > 0)
            {
                re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee,
                                                itemId_List.ToArray(), itemPrice_List.ToArray(), itemNums_List.ToArray(), Envior.cur_userId);
            }
            else
            {
                re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee, Envior.cur_userId);
            }


            //if (!checkEdit1.Checked)
            //	re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee,Envior.cur_userId);
            //else
            //	re = RegisterAction.RegisterPay(rc001, fa001, oldprice, bitprice, oldnums, newnums, old_regfee, new_regfee, Envior.cur_userId);

            if (re > 0)
            {
                dt_rc04.Rows.Clear();
                rc04Adapter.Fill(dt_rc04);

                if (XtraMessageBox.Show("缴费成功!现在打印财政【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    if (FinInvoice.GetCurrentPh() > 0)
                    {
                        if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            FinInvoice.Invoice(fa001);
                        }
                    }
                }

                //// 开税票
                if (dec_tax_sum > 0)
                {
                    //获取税务客户信息
                    Frm_TaxClientInfo frm_taxClient = new Frm_TaxClientInfo(txtEdit_rc003.Text);
                    if (frm_taxClient.ShowDialog() == DialogResult.OK)
                    {
                        TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;
                        if (TaxInvoice.GetNextInvoiceNo(fa001) > 0)
                        {
                            if (XtraMessageBox.Show("下一张税票代码:" + Envior.NEXT_BILL_CODE + "\r\n" + "票号:" + Envior.NEXT_BILL_NUM + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                TaxInvoice.Invoice(fa001, clientInfo);
                            }
                        }
                    }
                }


                if (XtraMessageBox.Show("现在打印缴费记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    //打印缴费记录
                    PrtServAction.PrtRegisterPayRecord(fa001, this.Handle.ToInt32());
                }
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }