Beispiel #1
0
        /// <summary>
        /// 打印清单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                if (gridView1.GetRowCellValue(rowHandle, "FA005") == null)
                {
                    MessageBox.Show("当前记录尚未开税务发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (gridView2.RowCount <= 7 /*AppInfo.TAXITEMCOUNT*/)
                {
                    MessageBox.Show("此笔业务没有发票清单", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                string s_fa001    = gridView1.GetRowCellValue(rowHandle, "FA001").ToString();
                string s_tax_code = PrtServAction.GetTaxCode(s_fa001);
                string s_tax_num  = PrtServAction.GetTaxNum(s_fa001);

                if (MessageBox.Show(@"打印当前发票清单?\r\n【类型】: " + s_tax_code + @"\r\n" + "【票号】:" + s_tax_num, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    //PrtServAction.PrintInvoice(s_fa001, Envior.mform.Handle.ToInt32());
                    Envior.mform.goldTax.InfoKind       = 2;                                                     //发票类型
                    Envior.mform.goldTax.InfoTypeCode   = s_tax_code;                                            //发票代码
                    Envior.mform.goldTax.InfoNumber     = Convert.ToInt32(s_tax_num);                            //发票号
                    Envior.mform.goldTax.InfoShowPrtDlg = 1;                                                     //是否显示确认对话框
                    Envior.mform.goldTax.GoodsListFlag  = 1;                                                     //打印发票
                    Envior.mform.goldTax.PrintInv();
                }
            }
        }
Beispiel #2
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();
            }
        }
Beispiel #3
0
 /// <summary>
 /// 打印
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BarButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (dt_cs.Rows.Count > 0)
     {
         PrtServAction.Print_Report_ClassStat(s_begin, s_end, Envior.mform.Handle.ToInt32());
     }
 }
Beispiel #4
0
        private void BarButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int    r_row   = gridView1.FocusedRowHandle;
            string s_ac001 = gridView1.GetRowCellValue(r_row, "AC001").ToString();

            PrtServAction.Print_HHZM(s_ac001, this.Handle.ToInt32());
        }
Beispiel #5
0
        /// <summary>
        /// 补打寄存标签
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                string s_rc001 = gridView1.GetRowCellValue(rowHandle, "RC001").ToString();
                PrtServAction.PrtRegisterLabel(s_rc001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #6
0
        /// <summary>
        /// 补打寄存标签
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem14_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                XtraMessageBox.Show("现在打印【寄存标签】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                string s_rc001 = gridView1.GetRowCellValue(rowHandle, "RC001").ToString();
                PrtServAction.PrtRegisterLabel(s_rc001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #7
0
        /// <summary>
        /// 补开发票
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string s_fa002   = string.Empty;
            string s_fa001   = string.Empty;
            int    rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                s_fa002 = gridView1.GetRowCellValue(rowHandle, "FA002").ToString();
                s_fa001 = gridView1.GetRowCellValue(rowHandle, "FA001").ToString();

                if (PrtServAction.IsInvoiced(s_fa001))
                {
                    MessageBox.Show("当前记录已开税务发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (!Envior.canInvoice)
                {
                    MessageBox.Show("当前用户没有打印发票权限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (!Envior.TAX_READY)
                {
                    MessageBox.Show("金税卡没有打开!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }



                Frm_taxClientInfo frm_client = new Frm_taxClientInfo();

                frm_client.swapdata["parent"] = this;
                frm_client.swapdata["title"]  = gridView1.GetRowCellValue(rowHandle, "FA003").ToString();

                if (frm_client.ShowDialog(this) == DialogResult.OK)
                {
                    InvoiceInfo invClient = Envior.mform.swapdata["clientinfo"] as InvoiceInfo;

                    //if (s_fa002.Equals("0") || s_fa002.Equals("1"))  //火化收费 or 临时性销售
                    //{
                    //	PrtServAction.Print_Fireinvoice(s_fa001, invClient, Envior.mform.Handle.ToInt32());
                    //}else if (s_fa002.Equals("2"))					 //寄存收费
                    //{
                    //	PrtServAction.Print_RegisterInvoice(s_fa001, invClient, Envior.mform.Handle.ToInt32());
                    //}
                    PrtServAction.Print_Invoice(s_fa001, invClient);
                }
                frm_client.Dispose();
                this.RefreshData();
            }
        }
Beispiel #8
0
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case 10001:
                int    commandNum   = m.WParam.ToInt32();
                string responseText = PrtServAction.GetResponseText(commandNum);
                MessageBox.Show(responseText, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                break;

            default:
                base.DefWndProc(ref m);                        ///调用基类函数处理非自定义消息。
                break;
            }
        }
Beispiel #9
0
        ///补打火化证明
        private void BarButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle < 0)
            {
                return;
            }

            string s_ac001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString();

            if (MessageBox.Show("现在打印【火化证明】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
            {
                PrtServAction.Print_HHZM(s_ac001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #10
0
        /// <summary>
        /// 补打火化证明
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem2_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle < 0)
            {
                return;
            }
            string s_ac001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString();

            if (gridView1.GetRowCellValue(rowHandle, "FA002").ToString() == "0")
            {
                //PrtServAction.Print_HHZM(s_ac001);
                PrtServAction.Print_HHZM(s_ac001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #11
0
        /// <summary>
        /// 补打寄存证
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem9_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //权限检查
            if (!AppAction.CheckRight("补打寄存证"))
            {
                return;
            }

            int rowHandle = gridView1.FocusedRowHandle;

            if (rowHandle >= 0)
            {
                XtraMessageBox.Show("现在打印【寄存证】!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                string s_rc001 = gridView1.GetRowCellValue(rowHandle, "RC001").ToString();
                PrtServAction.PrtRegisterCertBD(s_rc001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #12
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();
            }
        }
Beispiel #13
0
        /// <summary>
        /// 打印缴费记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                XtraMessageBox.Show("请先选择要打印的缴费记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int    row   = gridView1.GetSelectedRows()[0];
            string fa001 = string.Empty;

            if (row >= 0)
            {
                XtraMessageBox.Show("现在打印第" + (row + 1).ToString() + "条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                fa001 = gridView1.GetRowCellValue(row, "RC010").ToString();
                PrtServAction.PrtRegisterPayRecord(fa001, this.Handle.ToInt32());
            }
        }
Beispiel #14
0
        /// <summary>
        /// 连接打印服务
        /// </summary>
        private void ConnectPrtServ()
        {
            IntPtr hwnd = FindWindow(null, "prtserv");

            if (hwnd != IntPtr.Zero)
            {
                Envior.prtservHandle = hwnd;
                int prtConnId = int.Parse(SqlAssist.ExecuteScalar("select seq_prtserv.nextval from dual", null).ToString());

                ////建立连接
                PrtServAction.Connect(prtConnId, hwnd.ToInt32(), this.Handle.ToInt32());
                Envior.prtConnId = prtConnId;

                ////给打印服务窗口发消息 建立连接
                SendMessage(hwnd, 0x2710, 0, prtConnId);
            }
            else
            {
                MessageBox.Show("没有找到打印服务进程,不能打印!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Beispiel #15
0
        /// <summary>
        /// 补打火化登记单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem8_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string s_ac001 = string.Empty;

            if (gridView1.FocusedRowHandle >= 0)
            {
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "AC080") == null)
                {
                    MessageBox.Show("当前记录没有火化序号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (MessageBox.Show("现在打印【火化登记单】吗", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
                s_ac001 = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "AC001").ToString();

                PrtServAction.Print_CheckinNotice(s_ac001, Envior.mform.Handle.ToInt32());
            }
        }
Beispiel #16
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();
            }
        }
Beispiel #17
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();
            }
        }
Beispiel #18
0
        private void B_ok_Click(object sender, EventArgs e)
        {
            if (rc001 == null)
            {
                MessageBox.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");

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

            if (MessageBox.Show("确认要继续办理迁出吗?本业务将不能回退!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }
            if (Convert.ToDecimal(string.IsNullOrEmpty(txtEdit_fee.Text) ? "0":txtEdit_fee.Text) > 0 && Envior.cur_userId != AppInfo.ROOTID)
            {
                MessageBox.Show("当前记录已经欠费,不能迁出!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            int re = RegisterAction.RegisterOut(rc001,
                                                s_oc003,
                                                s_oc004,
                                                s_oc005,
                                                diff,
                                                fa001,
                                                price,
                                                isrefund ? 0 - nums : nums,
                                                Envior.cur_userId
                                                );

            if (re > 0)
            {
                MessageBox.Show("迁出办理成功!现在打印【迁出通知单】", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PrtServAction.PrtRegisterOutNotice(rc001, this.Handle.ToInt32());

                if (Math.Abs(nums) > 0)
                {
                    MessageBox.Show("现在打印【发票】!", "提示");
                    if (!Envior.canInvoice)
                    {
                        MessageBox.Show("当前用户没有打印发票权限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        Frm_taxClientInfo frm_client = new Frm_taxClientInfo();
                        frm_client.swapdata["parent"] = this;
                        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);
                        }
                    }
                }
            }
            DialogResult = DialogResult.OK;
            this.Close();
        }
Beispiel #19
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 && (!string.IsNullOrEmpty(txtEdit_nums.Text)))
            {
                nums = decimal.Parse(txtEdit_nums.Text);
            }
            else
            {
                nums = 0;
            }

            if (XtraMessageBox.Show("确认要继续办理迁出吗?本业务将不能回退!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == 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,
                                                Envior.cur_userId
                                                );

            if (re > 0)
            {
                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)                   //退费发票
                {
                    string           s_old_pjlx = string.Empty;
                    string           s_old_pjh  = string.Empty;
                    string           s_old_zch  = string.Empty;
                    OracleDataReader reader_log = SqlAssist.ExecuteReader("select * from fin_log where settleId ='" + last_fa001 + "'");
                    reader_log.Read();
                    if (reader_log.HasRows)
                    {
                        s_old_pjlx = reader_log["INVOICEKIND"].ToString();                            //票据类型
                        s_old_pjh  = reader_log["INVOICENO"].ToString();                              //票据号
                        s_old_zch  = reader_log["INVOICEZCH"].ToString();                             //注册号
                    }
                    else
                    {
                        XtraMessageBox.Show("读取缴费发票信息出错!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    reader_log.Dispose();
                    Frm_refundInfo frm_refund = new Frm_refundInfo(s_old_pjlx, s_old_pjh, s_old_zch);
                    if (frm_refund.ShowDialog() == DialogResult.OK)
                    {
                        s_old_zch = frm_refund.swapdata["zch"].ToString();                         //注册号
                        //if (!Envior.FIN_READY)
                        //	XtraMessageBox.Show("未连接到博思开票服务器!请稍后补开!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        //else
                        //{
                        //	string s_newpjh = FinInvoice.GetCurrentPh(Envior.FIN_INVOICE_TYPE);
                        //	if (String.IsNullOrEmpty(s_newpjh))
                        //		XtraMessageBox.Show("未获取到下一张财政发票号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        //	else
                        //	{
                        //		if (XtraMessageBox.Show("下一张财政发票号码:" + s_newpjh + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        //		{
                        //			string s_tkitem = MiscAction.GetItemInvoiceCode("08", "") + "	" + Math.Abs(nums * price) + "	";
                        //			FinInvoice.Refund(s_old_pjlx, s_old_pjh, s_old_zch, s_tkitem, "F_Qt1=xxx|F_Qt2=xxx|F_Qt3=xxx",fa001, s_newpjh,nums * price);
                        //		}
                        //	}
                        //}
                    }
                    frm_refund.Dispose();
                }
            }
            DialogResult = DialogResult.OK;
            this.Close();
        }
Beispiel #20
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();
            }
        }
Beispiel #21
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();
        }
Beispiel #22
0
        /// <summary>
        /// 收款作废
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int      rowHandle = gridView1.FocusedRowHandle;
            DateTime dt_fa200;                 //收费日期



            if (rowHandle >= 0)
            {
                //只能作废当日收费记录
                DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
                dtFormat.ShortDatePattern = "yyyy-MM-dd";
                dt_fa200 = Convert.ToDateTime(gridView1.GetRowCellValue(rowHandle, "FA200").ToString(), dtFormat);
                if (String.Compare(dt_fa200.ToString("yyyy-MM-dd"), MiscAction.GetServerDateString()) < 0 && Envior.cur_userId != AppInfo.ROOTID)
                {
                    MessageBox.Show("只能作废当天的收费记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (MessageBox.Show("确认要作废吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }
                string s_rc001 = gridView1.GetRowCellValue(rowHandle, "AC001").ToString();
                if (Convert.ToDecimal(gridView1.GetRowCellValue(rowHandle, "FA004")) < 0)
                {
                    MessageBox.Show("退费业务不能作废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                if (gridView1.GetRowCellValue(rowHandle, "FA002").ToString() == "2")                  //寄存业务
                {
                    decimal count = (decimal)SqlAssist.ExecuteScalar("select count(*) from v_rc04 where rc001='" + s_rc001 + "'", null);
                    if (count <= 1)
                    {
                        if (MessageBox.Show("此记录是唯一一次交费记录,作废此记录将删除寄存登记信息,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                        {
                            return;
                        }
                    }
                }

                string s_fa001   = gridView1.GetRowCellValue(rowHandle, "FA001").ToString();
                string s_fa005   = gridView1.GetRowCellValue(rowHandle, "FA005").ToString();                 //电子发票号
                string s_retCode = string.Empty;

                int re = MiscAction.FinanceRemove(s_fa001, Envior.cur_userId);
                if (re > 0)
                {
                    ////////// 发票作废 ///////////////////////////////////////////////////
                    if (!string.IsNullOrEmpty(s_fa005))
                    {
                        if (!Envior.TAX_READY)
                        {
                            MessageBox.Show("金税卡没有打开!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            s_retCode = PrtServAction.InvoiceRemoved(s_fa001, Envior.mform.Handle.ToInt32());
                        }
                    }
                    ///////////////////////////////////////////////////////////////////////

                    if (!string.IsNullOrEmpty(s_fa005) && s_retCode == "6011")
                    {
                        MessageBox.Show("作废成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else if (!string.IsNullOrEmpty(s_fa005) && s_retCode != "6011")
                    {
                        MessageBox.Show("作废成功但未作废发票!" + s_retCode, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        MessageBox.Show("作废成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }


                    //MessageBox.Show("作废成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dt_finance.Rows.RemoveAt(gridView1.GetDataSourceRowIndex(rowHandle));
                    if (gridView1.RowCount == 0)
                    {
                        dt_detail.Rows.Clear();
                    }
                    else
                    {
                        this.RetrieveDetail(gridView1.FocusedRowHandle);
                    }
                    return;
                }
            }
        }
Beispiel #23
0
        private void B_ok_Click(object sender, EventArgs e)
        {
            string        settleId   = Tools.GetEntityPK("FA01");
            List <string> sa001_list = new List <string>();

            foreach (DataRow r in dt_source.Rows)
            {
                sa001_list.Add(r["SA001"].ToString());
            }

            int result = FireAction.FireBusinessSettle(settleId,
                                                       AC001,
                                                       sa001_list.ToArray(),
                                                       Envior.cur_userId
                                                       );

            if (result > 0)
            {
                b_ok.Enabled = false;

                MessageBox.Show("结算办理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                int fire_row = gridView1.LocateByValue("SA002", "06");
                //如果有火化,打印火化证明
                if (fire_row >= 0)
                {                   //打印火化证明
                    if (MessageBox.Show("现在打印火化证明!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        PrtServAction.Print_HHZM(AC001, this.Handle.ToInt32());
                    }
                }

                if (MessageBox.Show("现在打印【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    if (!Envior.canInvoice)
                    {
                        MessageBox.Show("当前用户没有打印发票权限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else 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_Fireinvoice(settleId, invClient, this.Handle.ToInt32() );
                            PrtServAction.Print_Invoice(settleId, invClient);
                        }
                        frm_client.Dispose();
                    }
                }

                //打印付货单
                int jp_row = gridView1.LocateByValue("SA002", "12");                  //
                //如果有祭品 则打印付货单
                if (jp_row >= 0)
                {
                    if (MessageBox.Show("现在打印【付货单】吗?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrtServAction.Print_FHD(settleId, this.Handle.ToInt32());
                    }
                }

                DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
Beispiel #24
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            decimal dec_fin = new decimal(0);
            decimal dec_tax = new decimal(0);
            string  s_tip   = string.Empty;

            foreach (DataRow dr in dt_source.Rows)
            {
                if (dr["SA020"].ToString() == "F")
                {
                    dec_fin += Convert.ToDecimal(dr["SA007"]);
                }
                else if (dr["SA020"].ToString() == "T")
                {
                    dec_tax += Convert.ToDecimal(dr["SA007"]);
                }
            }

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

            if (XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            string        s_fa001    = Tools.GetEntityPK("FA01");
            string        s_cuname   = FireAction.GetGuyNameById(AC001);
            List <string> sa001_list = new List <string>();

            foreach (DataRow r in dt_source.Rows)
            {
                sa001_list.Add(r["SA001"].ToString());
            }

            int result = FireAction.FireBusinessSettle(s_fa001,
                                                       AC001,
                                                       s_cuname,
                                                       sa001_list.ToArray(),
                                                       Envior.cur_userId
                                                       );

            if (result > 0)
            {
                b_ok.Enabled = false;

                int fire_row = gridView1.LocateByValue("SA002", "06");
                //如果有火化,打印火化证明
                if (fire_row >= 0)
                {   //打印火化证明
                    if (XtraMessageBox.Show("现在打印火化证明?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        PrtServAction.Print_HHZM(AC001, 0);
                    }
                }

                XtraMessageBox.Show("结算成功!现在开始打印发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ////开财政票!
                if (dec_fin > 0)
                {
                    //string s_pjh = string.Empty;
                    //string s_zch = string.Empty;
                    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 > 0)
                {
                    //获取税务客户信息
                    string            s_ac003       = SqlAssist.ExecuteScalar("select ac003 from ac01 where ac001='" + AC001 + "'").ToString();
                    Frm_TaxClientInfo frm_taxClient = new Frm_TaxClientInfo(s_ac003);
                    if (frm_taxClient.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;

                    if (TaxInvoice.GetNextInvoiceNo() > 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);
                        }
                    }
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Beispiel #25
0
 /// <summary>
 /// 重新连接税务金卡
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BarButtonItem33_ItemClick(object sender, ItemClickEventArgs e)
 {
     PrtServAction.ReconnectTaxCard(this.Handle.ToInt32());
 }
Beispiel #26
0
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BarButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.RowCount == 0)
            {
                MessageBox.Show("没选择项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            ///检查是否有价格为0 的项目
            for (int i = 0; i < gridView1.RowCount; i++)
            {
                if (Convert.ToDecimal(gridView1.GetRowCellValue(i, "PRICE")) <= 0)
                {
                    MessageBox.Show("尚有未输入价格的项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    gridView1.SelectRow(i);
                    return;
                }
            }

            string s_cuname;

            if (string.IsNullOrEmpty(textEdit1.Text))
            {
                textEdit1.ErrorImageOptions.Alignment = ErrorIconAlignment.MiddleRight;
                textEdit1.ErrorText = "请输入交款单位!";
                return;
            }
            else
            {
                s_cuname = textEdit1.EditValue.ToString();
            }

            List <string>  itemId_List   = new List <string>();
            List <string>  itemType_List = new List <string>();
            List <decimal> prict_List    = new List <decimal>();
            List <decimal> nums_List     = new List <decimal>();

            for (int i = 0; i < gridView1.RowCount; i++)
            {
                itemId_List.Add(gridView1.GetRowCellValue(i, "SA004").ToString());
                itemType_List.Add(gridView1.GetRowCellValue(i, "SA002").ToString());
                prict_List.Add(decimal.Parse(gridView1.GetRowCellValue(i, "PRICE").ToString()));
                nums_List.Add(decimal.Parse(gridView1.GetRowCellValue(i, "NUMS").ToString()));
            }
            string settleId = Tools.GetEntityPK("FA01");
            int    re       = FireAction.TempSalesSettle(
                s_cuname, settleId, itemId_List.ToArray(), itemType_List.ToArray(), prict_List.ToArray(), nums_List.ToArray(), Envior.cur_userId);

            if (re > 0)
            {
                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"] = Envior.mform;
                        frm_client.swapdata["title"]  = textEdit1.Text;

                        if (frm_client.ShowDialog(Envior.mform) == DialogResult.OK)
                        {
                            InvoiceInfo invClient = Envior.mform.swapdata["clientinfo"] as InvoiceInfo;

                            //打印发票
                            //PrtServAction.Print_Fireinvoice(settleId, invClient, Envior.mform.Handle.ToInt32());
                            PrtServAction.Print_Invoice(settleId, invClient);
                        }
                        frm_client.Dispose();
                    }
                }

                //打印付货单
                int jp_row = gridView1.LocateByValue("SA002", "12");                  //
                //如果有祭品 则打印付货单
                if (jp_row >= 0)
                {                   //打印火化证明
                    if (MessageBox.Show("现在打印【付货单】吗?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrtServAction.Print_FHD(settleId, this.Handle.ToInt32());
                    }
                }

                textEdit1.Text = "";
                sa01_ds.Sa01.Rows.Clear();
            }
        }
Beispiel #27
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();
            }
        }
Beispiel #28
0
        private void B_ok_Click(object sender, EventArgs e)
        {
            if (!SaveCheck())
            {
                return;                //数据合法性校验!!!
            }
            if (action.Equals("add"))
            {
                ac01.ac001 = Tools.GetEntityPK("AC01");
                ac01.ac100 = Envior.cur_userId;                 //经办人
                ac01.ac200 = DateTime.Now;                      //经办日期
            }


            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;                //籍贯-详细地址
            ac01.ac006 = lookup_ash.EditValue.ToString();   //骨灰处理方式
            ac01.ac070 = lookup_ac070.EditValue.ToString();

            if (dateEdit_ac010.EditValue != null)
            {
                ac01.ac010 = DateTime.Parse(dateEdit_ac010.EditValue.ToString()); //死亡时间
            }
            ac01.ac009 = txtEdit_ac009.Text;                                      //接灵地址

            ac01.ac020 = DateTime.Parse(dateEdit_ac020.EditValue.ToString());     //到达中心时间

            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.ac055 = txtEdit_ac055.Text;                //联系地址

            if (lookUp_ac060.EditValue != null)
            {
                ac01.ac060 = lookUp_ac060.EditValue.ToString(); //灵车司机
            }
            ac01.ac110  = Envior.cur_userId;                    //最后经办人
            ac01.ac220  = DateTime.Now;                         //最后经办日期
            ac01.ac099  = mem_ac099.Text;                       //备注
            ac01.status = "1";                                  //当前状态

            if (action.Equals("add"))
            {
                if (lookup_ash.EditValue.ToString() != "2" /*骨灰寄存:放弃*/)
                {
                    ac01.ac080        = FireAction.GenFireOrder(lookup_ac070.EditValue.ToString());
                    label_forder.Text = ac01.ac080.ToString();
                }
            }


            try
            {
                string s_tip = "保存成功!";
                if (action.Equals("add"))
                {
                    ac01_dao.Insert(ac01);
                    if (ac01.ac080 != null)
                    {
                        s_tip = s_tip + "\r\n" + "火化序号:" + ac01.ac080.ToString();
                    }
                }
                else
                {
                    ac01_dao.Update(ac01);
                }

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

                if (action.Equals("add"))
                {
                    if (MessageBox.Show("现在打印【火化登记单】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        PrtServAction.Print_CheckinNotice(ac01.ac001, this.Handle.ToInt32());
                    }
                }

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

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show("保存数据失败!\n" + ee.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }