/// <summary> /// 新增预交金记录 /// </summary> /// <param name="PrePay_VO"></param> /// <returns></returns> public long m_lngAddPrePay(clsBihPrePay_VO PrePay_VO, out string PrePayID) { com.digitalwave.iCare.middletier.HIS.clsPrePay objSvc = (com.digitalwave.iCare.middletier.HIS.clsPrePay)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsPrePay)); long l = objSvc.m_lngAddPrePay(PrePay_VO, out PrePayID); objSvc.Dispose(); return(l); }
public long m_lngAddPrePay(clsBihPrePay_VO PrePay_VO, out string PrePayID) { long lngRes = 0, lngAffects = 0; PrePayID = ""; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); IDataParameter[] ParamArr = null; DataTable dt = new DataTable(); //取预交金序列ID string SQL = "select lpad(seq_prepayid.NEXTVAL, 12, '0') from dual"; lngRes = objHRPSvc.lngGetDataTableWithoutParameters(SQL, ref dt); if (lngRes > 0) { PrePayID = dt.Rows[0][0].ToString(); } SQL = @"insert into t_opr_bih_prepay (prepayid_chr, patientid_chr, registerid_chr, paytype_int, cuycate_int, money_dec, prepayinv_vchr, areaid_chr, des_vchr, creatorid_chr, create_dat, status_int, isclear_int, uptype_int, patientname_chr, areaname_vchr, balanceflag_int) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate, 1, 0, ?, ?, ?, 0)"; objHRPSvc.CreateDatabaseParameter(13, out ParamArr); ParamArr[0].Value = PrePayID; ParamArr[1].Value = PrePay_VO.strPatientID; ParamArr[2].Value = PrePay_VO.strRegisterID; ParamArr[3].Value = PrePay_VO.intPayType; ParamArr[4].Value = PrePay_VO.intCuyCate; ParamArr[5].Value = PrePay_VO.decMoney; ParamArr[6].Value = PrePay_VO.strPrePayInv; ParamArr[7].Value = PrePay_VO.strAreaID; ParamArr[8].Value = PrePay_VO.strDes; ParamArr[9].Value = PrePay_VO.strCreatorID; ParamArr[10].Value = PrePay_VO.intUpType; ParamArr[11].Value = PrePay_VO.strPatientName; ParamArr[12].Value = PrePay_VO.strAreaName; lngRes = objHRPSvc.lngExecuteParameterSQL(SQL, ref lngAffects, ParamArr); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
/// <summary> /// 收费 /// </summary> public void m_mthCharge() { if (this.m_objViewer.ucPatientInfo.RegisterID == "") { return; } //取值 string RegID = this.m_objViewer.ucPatientInfo.RegisterID; string Zyh = this.m_objViewer.ucPatientInfo.BihPatient_VO.Zyh; string CardNo = this.m_objViewer.ucPatientInfo.BihPatient_VO.CardNO; string BillNo = this.m_objViewer.txtprebillno.Text.Trim(); string Money = this.m_objViewer.txtMoney.Text.Trim(); string PayType = this.m_objViewer.cbopaytype.SelectedIndex.ToString(); string Note = this.m_objViewer.txtnote.Text.Trim(); //校验 if (BillNo == "") { MessageBox.Show("请输入预交单号!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtprebillno.Focus(); this.m_objViewer.txtprebillno.SelectAll(); return; } if (Money == "") { MessageBox.Show("请输入预交金额!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtMoney.Focus(); this.m_objViewer.txtMoney.SelectAll(); return; } if (!Microsoft.VisualBasic.Information.IsNumeric(Money)) { MessageBox.Show("金额必须是数字,请重新输入!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtMoney.Focus(); this.m_objViewer.txtMoney.SelectAll(); return; } if (Convert.ToDecimal(Money) <= 0) { MessageBox.Show("金额必须是正数,请重新输入!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtMoney.Focus(); this.m_objViewer.txtMoney.SelectAll(); return; } if (PayType == "-1") { MessageBox.Show("请选择支付类型!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.cbopaytype.Focus(); return; } if (this.PreType == "0") { if (!clsPublic.m_blnCheckPrepayNoExpression(BillNo)) { MessageBox.Show("当前输入的预交单号不符合编码规则,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtprebillno.Focus(); this.m_objViewer.txtprebillno.SelectAll(); return; } } //if (clsPublic.m_blnCheckPrepayNoIsUsed(BillNo, int.Parse(PreType))) if (clsPublic.m_blnCheckPrepayNoIsUsed(BillNo, 0)) { MessageBox.Show("当前输入的预交单号已经被使用,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.m_objViewer.txtprebillno.Focus(); this.m_objViewer.txtprebillno.SelectAll(); return; } frmPrepayAlert fa = new frmPrepayAlert(this.m_objViewer.cbopaytype.Text.Substring(2), clsPublic.DoubleConvertToCurrency(double.Parse(Money))); if (fa.ShowDialog() == DialogResult.No) { return; } this.m_objViewer.Cursor = Cursors.WaitCursor; //赋值 clsBihPrePay_VO PrePay_VO = new clsBihPrePay_VO(); PrePay_VO.strPrePayInv = BillNo; PrePay_VO.strPatientID = this.m_objViewer.ucPatientInfo.BihPatient_VO.PatientID; PrePay_VO.strRegisterID = RegID; PrePay_VO.decMoney = clsPublic.ConvertObjToDecimal(Money); PrePay_VO.intPayType = 1; PrePay_VO.intCuyCate = int.Parse(PayType) + 1; PrePay_VO.strAreaID = this.m_objViewer.ucPatientInfo.BihPatient_VO.AreaID; PrePay_VO.strDes = Note; PrePay_VO.strCreatorID = this.m_objViewer.LoginInfo.m_strEmpID; PrePay_VO.intUpType = int.Parse(PreType); PrePay_VO.strPatientName = this.m_objViewer.ucPatientInfo.lblName.Text; PrePay_VO.strAreaName = this.m_objViewer.ucPatientInfo.txtArea.Text; //保存 string PrePayID = ""; long l = this.objSvc.m_lngAddPrePay(PrePay_VO, out PrePayID); if (l > 0) { clsPublic.m_blnSaveCurrInvoiceNo(this.m_objViewer.LoginInfo.m_strEmpID, BillNo, 2); this.m_blnSavePrePayBillNo(BillNo); if (this.PreType == "0") { //this.m_objViewer.txtprebillno.Text = Convert.ToString(int.Parse(BillNo) + 1); this.m_objViewer.txtprebillno.Text = ""; } else { this.m_objViewer.txtprebillno.Text = ""; } this.m_mthGetPrePayHistoryInfo(); this.m_mthInit(); try { if (PreType == "0") { if (NorPrint) { clsPBNetPrint.m_mthPrintPrepayBill(PrePayID, ""); } } else if (PreType == "1") { if (HandPrint) { clsPBNetPrint.m_mthPrintPrepayBill(PrePayID, ""); } } this.m_objViewer.ucPatientInfo.m_mthFind(Zyh, 2); //clsPublic.m_mthWriteParm(RegID, Zyh, CardNo); this.m_objViewer.Cursor = Cursors.Default; //MessageBox.Show("收费成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.m_objViewer.btnFind.Focus(); } catch { this.m_objViewer.Cursor = Cursors.Default; } } else { this.m_objViewer.Cursor = Cursors.Default; MessageBox.Show("保存数据失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }