コード例 #1
0
ファイル: clsCtlPrepayQuery.cs プロジェクト: iamwsx05/HIS
        /// <summary>
        /// 重打预交金发票
        /// </summary>
        internal void RePrintInvoice()
        {
            if (this.m_objViewer.m_dataGridViewRs.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选择需要重打的预交金记录。");
                return;
            }

            string prepayId  = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PREPAYID_CHR"].Value.ToString();
            string preInvoNo = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PREPAYINV_VCHR"].Value.ToString();
            string preStatus = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PAYTYPE_INT"].Value.ToString();

            if (preStatus == "正常" || preStatus == "恢复")
            {
                // 正常预交.微信
                frmPrePayRepeatPrn fpprp = new frmPrePayRepeatPrn(preInvoNo, 0, this.m_objViewer.LoginInfo.m_strEmpID);
                if (fpprp.ShowDialog() == DialogResult.OK)
                {
                    string prntype = fpprp.PrnType;
                    string newno   = fpprp.NewNo;
                    if (prntype == "1")
                    {
                        clsPBNetPrint.m_mthPrintPrepayBill(prepayId, "");
                    }
                    else if (prntype == "2")
                    {
                        clsDcl_PrePay dclPrepay = new clsDcl_PrePay();
                        long          l         = dclPrepay.m_lngSaveRepeatPrn(prepayId, preInvoNo, newno, this.m_objViewer.LoginInfo.m_strEmpID, "1");
                        if (l > 0)
                        {
                            clsPBNetPrint.m_mthPrintPrepayBill(prepayId, newno);
                            clsPublic.m_blnSaveCurrInvoiceNo(this.m_objViewer.LoginInfo.m_strEmpID, newno, 2);
                            clsPublic.m_blnWriteXML("BeInHospital", "CurrPrepayBillNo", "AnyOne", newno);
                        }
                        else
                        {
                            MessageBox.Show("保存重打信息失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }
                        dclPrepay = null;
                    }
                    else if (prntype == "3")
                    {
                        clsPBNetPrint.m_mthPrintPrepayBill(prepayId, newno);
                    }
                }
            }
            else
            {
                MessageBox.Show("不能重打。");
            }
        }
コード例 #2
0
ファイル: clsCtl_PrePay.cs プロジェクト: iamwsx05/HIS
        /// <summary>
        /// 重打
        /// </summary>
        public void m_mthRepeatPrn()
        {
            if (this.m_objViewer.dtgHistory.Rows.Count == 0)
            {
                return;
            }

            if (this.m_objViewer.dtgHistory.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选择需要重打的按金单据!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DataRow dr = this.m_objViewer.dtgHistory.SelectedRows[0].Tag as DataRow;

            if (dr["paytype_int"].ToString() == "2")
            {
                if (MessageBox.Show("该按金单已退票,是否确认重打?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
                {
                    return;
                }
                //MessageBox.Show("已退款的按金单据不能重打。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //return;
            }

            string prepayid = dr["prepayid_chr"].ToString();
            string oldno    = dr["prepayinv_vchr"].ToString();

            frmPrePayRepeatPrn fpprp = new frmPrePayRepeatPrn(oldno, int.Parse(PreType), this.m_objViewer.LoginInfo.m_strEmpID);

            if (fpprp.ShowDialog() == DialogResult.OK)
            {
                string prntype = fpprp.PrnType;
                string newno   = fpprp.NewNo;

                if (prntype == "1")
                {
                    clsPBNetPrint.m_mthPrintPrepayBill(prepayid, "");
                    //clsInviocePrint_GD.m_mthPrintPrepayBill(prepayid, "");
                }
                else if (prntype == "2")
                {
                    long l = this.objSvc.m_lngSaveRepeatPrn(prepayid, oldno, newno, this.m_objViewer.LoginInfo.m_strEmpID, "1");
                    if (l > 0)
                    {
                        clsPBNetPrint.m_mthPrintPrepayBill(prepayid, newno);
                        //clsInviocePrint_GD.m_mthPrintPrepayBill(prepayid, newno);
                        clsPublic.m_blnSaveCurrInvoiceNo(this.m_objViewer.LoginInfo.m_strEmpID, newno, 2);
                        this.m_blnSavePrePayBillNo(newno);

                        //this.m_objViewer.txtprebillno.Text = Convert.ToString(int.Parse(newno) + 1);
                        this.m_objViewer.txtprebillno.Text = "";//m_mthInit()方法会初始化
                        this.m_mthInit();
                    }
                    else
                    {
                        MessageBox.Show("保存重打信息失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                }
                else if (prntype == "3")
                {
                    clsPBNetPrint.m_mthPrintPrepayBill(prepayid, newno);
                }
            }
        }