示例#1
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (rc001 == null)
            {
                XtraMessageBox.Show("数据传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (txtEdit_oc003.EditValue == null || txtEdit_oc003.EditValue is System.DBNull)
            {
                txtEdit_oc003.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                txtEdit_oc003.ErrorText = "请输入迁出办理人!";
                return;
            }
            if (mem_oc005.EditValue == null)
            {
                mem_oc005.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                mem_oc005.ErrorText = "请输入迁出原因!";
                return;
            }
            string s_oc003 = txtEdit_oc003.Text;               //迁出人
            string s_oc005 = mem_oc005.Text;                   //迁出原因
            string s_oc004 = txtEdit_oc004.Text;               //迁出人身份证号

            int     diff       = int.Parse(txtEdit_diff.EditValue.ToString());
            decimal nums       = decimal.Zero;
            string  fa001      = Tools.GetEntityPK("FA01");
            string  last_fa001 = RegisterAction.GetREGLastSettleId(rc001);                //获取最后一次缴费 结算流水号

            //补退情况
            if (checkEdit1.Checked)
            {
                nums = decimal.Parse(txtEdit_nums.Text);
            }
            else
            {
                nums = 0;
            }

            if (XtraMessageBox.Show("确认要继续办理迁出吗?本业务将不能回退!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }
            if (checkEdit1.Checked && Math.Abs(regfee) > 0)
            {
                if (XtraMessageBox.Show("迁出需要补退费" + regfee.ToString("##,##0.00") + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }

            if ((!string.IsNullOrEmpty(txtEdit_fee.Text)) && Convert.ToDecimal(txtEdit_fee.Text) > 0 && Envior.cur_userId != AppInfo.ROOTID && !isrefund)
            {
                XtraMessageBox.Show("当前记录已经欠费,不能迁出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }



            int re = RegisterAction.RegisterOut(rc001,
                                                s_oc003,
                                                s_oc004,
                                                s_oc005,
                                                diff,
                                                fa001,
                                                price,
                                                isrefund ? 0 - nums : nums,
                                                isrefund ? 0 - Math.Abs(regfee) : Math.Abs(regfee),
                                                Envior.cur_userId
                                                );

            if (re > 0)
            {
                //保存迁出人信息
                if (IDC_FLAG)
                {
                    ic01_dao.Insert(ic01);
                    ///更新身份证照片
                    if (ic01 != null)
                    {
                        FileStream file    = new FileStream("zp.bmp", FileMode.Open, FileAccess.Read);
                        Byte[]     imgByte = new Byte[file.Length];                   //把图片转成 Byte型 二进制流
                        file.Read(imgByte, 0, imgByte.Length);                        //把二进制流读入缓冲区
                        file.Close();
                        MiscAction.Update_IDC_Photo(ic01.ic001, imgByte);
                    }
                }

                XtraMessageBox.Show("迁出办理成功!现在打印【迁出通知单】", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PrtServAction.PrtRegisterOutNotice(rc001, this.Handle.ToInt32());

                if (!isrefund && nums > 0)
                {
                    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);
                            }
                        }
                    }
                }
                else if (isrefund && Math.Abs(nums) > 0)                    //退费发票
                {
                    //如果是新版接口上线前开具的原发票
                    if (MiscAction.FinRefundBeforeOnline(fa001))
                    {
                        XtraMessageBox.Show("原发票在财政新接口上线前开具,不能开具对应退费发票,请在财政发票系统内完成发票开具.\r\n 开具成功后请更新发票号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else if (FinInvoice.GetCurrentPh() > 0)
                    {
                        if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            FinInvoice.Refund(fa001);
                        }
                    }
                }
            }
            DialogResult = DialogResult.OK;
            this.Close();
        }
示例#2
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (!gridView1.PostEditor())
            {
                return;
            }
            if (!gridView1.UpdateCurrentRow())
            {
                return;
            }
            if (!SaveCheck())
            {
                return;                            //数据合法性校验!!!
            }
            if (source == "1")
            {
                ac001 = Tools.GetEntityPK("RC01");                                    //逝者编号
            }
            string s_fa001 = source == "0"? string.Empty : Tools.GetEntityPK("FA01"); //结算流水号
            string s_rc109 = RegisterAction.GenRegisterNo("0");                       //正常登记寄存证号
            string s_rc002 = rg_rc002.EditValue.ToString();                           //性别
            string s_rc202 = rg_rc202.EditValue.ToString();                           //性别2
            string s_rc003 = txtEdit_rc003.Text;                                      //逝者姓名
            string s_rc303 = txtEdit_rc303.Text;                                      //逝者姓名2
            int    rc004   = int.Parse(txtEdit_rc004.Text);                           //年龄
            int    rc404;

            if (!string.IsNullOrEmpty(txtEdit_rc404.Text))
            {
                rc404 = int.Parse(txtEdit_rc404.Text);
            }
            else
            {
                rc404 = 0;
            }

            string   s_rc014     = txtedit_rc014.Text;                        //身份证号
            string   s_rc050     = txtEdit_rc050.Text;                        //联系人
            string   s_rc051     = txtEdit_rc051.Text;                        //联系电话
            string   s_rc052     = lookUp_rc052.EditValue.ToString();         //与逝者关系
            string   s_rc055     = txtEdit_ac055.Text;                        //联系地址
            string   s_rc099     = mem_rc099.Text;                            //备注
            DateTime d_rc140     = DateTime.Now;                              //寄存日期
            decimal  nums        = decimal.Parse(comboBox1.Text);             //缴费年限
            decimal  dec_tax_sum = new decimal(0);

            //输入交款人信息
            string s_cuname = s_rc003;

            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 register_ds.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"]);
                    }
                }
            }
            string s_tip = string.Empty;

            if (dec_tax_sum > 0)
            {
                s_tip = "本次结算共需要一张财政发票和一张税务发票,是否继续?";
            }
            else
            {
                s_tip = "本次结算共需要一张财政发票,是否继续?";
            }


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

            int re = 0;

            if (fpfee > 0)
            {
                re = RegisterAction.RegisterEnroll(ac001,
                                                   s_rc109,
                                                   s_fa001,
                                                   s_rc002,
                                                   s_rc202,
                                                   s_rc003,
                                                   s_rc303,
                                                   rc004,
                                                   rc404,
                                                   s_rc014,
                                                   s_rc050,
                                                   s_rc051,
                                                   s_rc052,
                                                   s_rc055,
                                                   s_rc099,
                                                   bitId,
                                                   bitPrice,
                                                   d_rc140,
                                                   d_rc140,
                                                   nums,
                                                   regfee,
                                                   source,
                                                   itemId_List.ToArray(),
                                                   itemPrice_List.ToArray(),
                                                   itemNums_List.ToArray(),
                                                   Envior.cur_userId
                                                   );
            }
            else
            {
                re = RegisterAction.RegisterEnroll(ac001,
                                                   s_rc109,
                                                   s_fa001,
                                                   s_rc002,
                                                   s_rc202,
                                                   s_rc003,
                                                   s_rc303,
                                                   rc004,
                                                   rc404,
                                                   s_rc014,
                                                   s_rc050,
                                                   s_rc051,
                                                   s_rc052,
                                                   s_rc055,
                                                   s_rc099,
                                                   bitId,
                                                   bitPrice,
                                                   d_rc140,
                                                   d_rc140,
                                                   nums,
                                                   regfee,
                                                   source,
                                                   Envior.cur_userId
                                                   );
            }

            if (IDC_FLAG)
            {
                ic01.ac001 = ac001;
                ic01_dao.Insert(ic01);

                ///更新身份证照片
                FileStream file    = new FileStream("zp.bmp", FileMode.Open, FileAccess.Read);
                Byte[]     imgByte = new Byte[file.Length];           //把图片转成 Byte型 二进制流
                file.Read(imgByte, 0, imgByte.Length);                //把二进制流读入缓冲区
                file.Close();
                MiscAction.Update_IDC_Photo(ic01.ic001, imgByte);
            }

            if (re > 0 && source == "0")
            {
                XtraMessageBox.Show("寄存办理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else if (re > 0 && source == "1" /* 外来寄存 */)
            {
                if (XtraMessageBox.Show("现在打印【骨灰寄存证】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    PrtServAction.PrtRegisterCert(ac001, s_fa001, Envior.mform.Handle.ToInt32());
                }
                //if (XtraMessageBox.Show("现在打印【寄存标签】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                //{
                //	PrtServAction.PrtRegisterLabel(ac001,this.Handle.ToInt32());
                //}

                txtEdit_rc001.EditValue = ac001;
                txtEdit_rc109.EditValue = s_rc109;
                XtraMessageBox.Show("寄存登记成功!现在开始开具发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ///开财政票
                if (FinInvoice.GetCurrentPh() > 0)
                {
                    if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        FinInvoice.Invoice(s_fa001);
                    }
                }

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


                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)
        {
            if (!SaveCheck())
            {
                return;                            //数据合法性校验!!!
            }
            if (action.Equals("add"))
            {
                ac01.ac001 = Tools.GetEntityPK("AC01");
            }


            ac01.ac002 = rg_ac002.EditValue.ToString();                 //性别
            ac01.ac003 = txtEdit_ac003.Text;                            //逝者姓名
            ac01.ac004 = int.Parse(txtEdit_ac004.Text);                 //年龄
            ac01.ac005 = lookUp_ac005.EditValue.ToString();             //死亡原因
            ac01.ac014 = txtedit_ac014.Text;                            //身份证号
            ac01.ac007 = lookUp_ac007.EditValue.ToString();             //籍贯-所属区县
            ac01.ac008 = txtEdit_ac008.Text;                            //籍贯-详细地址

            if (ic01 != null)
            {
                ic01.ac001 = ac01.ac001;
            }

            if (dateEdit_ac010.EditValue != null)
            {
                ac01.ac010 = DateTime.Parse(dateEdit_ac010.EditValue.ToString()); //死亡时间
            }
            ac01.ac009 = txtEdit_ac009.Text;                                      //接灵地址
            ac01.ac050 = txtEdit_ac050.Text;                                      //联系人
            ac01.ac051 = txtEdit_ac051.Text;                                      //联系电话

            if (!(lookUp_ac052.EditValue == null || lookUp_ac052.EditValue is System.DBNull))
            {
                ac01.ac052 = lookUp_ac052.EditValue.ToString();                 //与逝者关系
            }

            ac01.ac150 = txtEdit_ac150.Text;                            //联系人
            ac01.ac151 = txtEdit_ac151.Text;                            //联系电话

            if (!(lookUp_ac152.EditValue == null || lookUp_ac152.EditValue is System.DBNull))
            {
                ac01.ac152 = lookUp_ac152.EditValue.ToString();                 //与逝者关系
            }


            ac01.ac055 = txtEdit_ac055.Text;                            //联系地址

            if (lookUp_ac060.EditValue != null)
            {
                ac01.ac060 = lookUp_ac060.EditValue.ToString();                 //灵车司机
            }
            if (action.Equals("add"))
            {
                ac01.ac100 = Envior.cur_userId;                                 //经办人
                ac01.ac200 = DateTime.Now;                                      //经办日期
            }

            ac01.ac110  = Envior.cur_userId;                            //最后经办人
            ac01.ac220  = DateTime.Now;                                 //最后经办日期
            ac01.ac099  = mem_ac099.Text;                               //备注
            ac01.status = "1";                                          //当前状态
            ac01.ac300  = lookup_gtype.EditValue.ToString();
            try
            {
                string s_tip = "保存成功!";
                if (action.Equals("add"))
                {
                    ac01_dao.Insert(ac01);
                    if (IDC_FLAG)
                    {
                        ic01_dao.Insert(ic01);
                    }
                }
                else
                {
                    ac01_dao.Update(ac01);
                    if (IDC_FLAG)
                    {
                        ic01_dao.Update(ic01);
                    }
                }

                ///更新身份证照片
                if (IDC_FLAG && ic01 != null)
                {
                    FileStream file    = new FileStream("zp.bmp", FileMode.Open, FileAccess.Read);
                    Byte[]     imgByte = new Byte[file.Length];               //把图片转成 Byte型 二进制流
                    file.Read(imgByte, 0, imgByte.Length);                    //把二进制流读入缓冲区
                    file.Close();
                    MiscAction.Update_IDC_Photo(ic01.ic001, imgByte);
                }

                XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                //TODO 1.登记完成立即办理业务!

                if (businessObject != null)
                {
                    businessObject.swapdata["AC001"] = ac01.ac001;
                }

                this.DialogResult = DialogResult.OK;
                this.Close();

                if (action.Equals("add") && XtraMessageBox.Show("现在办理业务吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Envior.mform.openBusinessObject("FireBusiness", ac01.ac001);
                }
            }
            catch (Exception ee)
            {
                XtraMessageBox.Show("保存数据失败!\n" + ee.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }