Ejemplo n.º 1
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (!SaveCheck()) return;  //数据合法性校验!!!

            string s_rc001 = Tools.GetEntityPK("RC01");         //逝者编号
            string s_fa001 = Tools.GetEntityPK("FA01");         //结算流水号

            string s_rc109 = RegisterAction.GenRegisterNo("1"); //原始登记寄存证号
            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 = Convert.ToDateTime(txtEdit_rc140.EditValue);   //寄存日期
            DateTime d_rc150 = Convert.ToDateTime(txtEdit_rc150.EditValue);   //截至日期

            List<string> itemId_List = new List<string>() { "" };
            List<decimal> itemPrice_List = new List<decimal>() { 1 };
            List<int> itemNums_List = new List<int>() { 1 };

            int re = RegisterAction.RegisterEnroll(s_rc001,
                                                    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,
                                                    0,
                                                    d_rc140,
                                                    d_rc150,
                                                    0,
                                                    0,
                                                    "2",
                                                    Envior.cur_userId
                );
            if (re > 0)
            {
                txtEdit_rc001.EditValue = s_rc001;
                txtEdit_rc109.EditValue = s_rc109;
                if (MessageBox.Show("办理成功!现在打印【骨灰寄存证】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    PrtServAction.PrtRegisterCert(s_rc001, s_fa001, this.Handle.ToInt32()) ; ;
                }
                //if (MessageBox.Show("现在打印【寄存标签】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                //{
                //    //PrtServAction.PrtRegisterLabel(s_rc001);

                //}
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 3
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 = 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);                 //缴费年限



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

            int re = 0;

            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"]));
                }
                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,
                                                   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,
                                                   source,
                                                   Envior.cur_userId
                                                   );
            }

            if (re > 0)
            {
                txtEdit_rc001.EditValue = ac001;
                txtEdit_rc109.EditValue = s_rc109;
                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(ac001);
                        if (frm_client.ShowDialog(this) == DialogResult.OK)
                        {
                            InvoiceInfo invClient = this.swapdata["clientinfo"] as InvoiceInfo;

                            //打印发票
                            //PrtServAction.Print_RegisterInvoice(s_fa001, invClient, this.Handle.ToInt32());
                            PrtServAction.Print_Invoice(s_fa001, invClient);
                        }
                        frm_client.Dispose();
                    }
                }
                if (MessageBox.Show("办理成功!现在打印【骨灰寄存证】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    PrtServAction.PrtRegisterCert(ac001, s_fa001, this.Handle.ToInt32());
                }
                if (MessageBox.Show("现在打印【寄存标签】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    PrtServAction.PrtRegisterLabel(ac001, this.Handle.ToInt32());
                }


                DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }