private void FrmRechargeSuccessful_Load(object sender, EventArgs e) { ucTime1.Sec = 60; ucTime1.timer1.Start(); this.lblRechargeMoney.Text = "您已成功充值" + RechargeMoney + "元"; SkyComm.GetCardBalance(); this.lblye.Text = SkyComm.cardBlance.ToString() + "元"; }
private string Postprepay() { AdvanceRecordData AdvData = new AdvanceRecordData(); bool IfForegift = false;//不确定是否以后会在转账时扣住院押金 string AdvanceID = ""; ChargeTypeFacade chargeTypeFacade = new ChargeTypeFacade(); DataRow dr = AdvData.Tables[0].NewRow(); dr[AdvanceRecordData.H_ADVANCE_RECORD_ADVANCEID] = "新增"; dr[AdvanceRecordData.H_ADVANCE_RECORD_BUSINESSBANK] = ""; //开户银行 dr[AdvanceRecordData.H_ADVANCE_RECORD_CANCELMARK] = 0; dr[AdvanceRecordData.H_ADVANCE_RECORD_CHEQUEID] = ""; //支票号 dr[AdvanceRecordData.H_ADVANCE_RECORD_CURRENTINHOSMARK] = GetInHosInfo(_inHosID).Tables[0].Rows[0]["CURRENTINHOSMARK"].ToString(); dr[AdvanceRecordData.H_ADVANCE_RECORD_INHOSID] = _inHosID; dr[AdvanceRecordData.H_ADVANCE_RECORD_OFFICEID] = _inHosOfficeID;//this.txtZyks.Text; dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATEDATE] = new CommonFacade().GetServerDateTime().ToString("yyyy-MM-dd HH:mm:ss.ffff"); dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATORID] = SysOperatorInfo.OperatorID; //支付类型ID及支付类型名称 dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMODEID] = SkyComm.getvalue("住院预交金充值方式_门诊预交金").ToString();//case21248 2015-5-4 yuanxiaoxia ID字段来源于界面加载 dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMODE] = "门诊预交金"; decimal ForegiftMoney = 0; if (IfForegift == true) { dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMONEY] = DecimalRound.Round(Convert.ToDecimal(this.lblhm.Text) - ForegiftMoney, 2); } else { dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMONEY] = DecimalRound.Round(Convert.ToDecimal(this.lblhm.Text), 2); } dr[AdvanceRecordData.H_ADVANCE_RECORD_RECEIPTID] = string.Empty; AdvData.Tables[0].Rows.Add(dr); try { AdvanceRecordFacade fac = new AdvanceRecordFacade(); AdvanceID = fac.insertEntity(AdvData.GetChanges(), IfForegift); SkyComm.GetCardBalance(); this.lblMzYe.Text = SkyComm.cardBlance.ToString(); this.lblZyYe.Text = Convert.ToString(Convert.ToDecimal(this.lblhm.Text) + Convert.ToDecimal(lblZyYe.Text)); } catch (Exception err) { SkyComm.ShowMessageInfo(err.Message); AdvData.Tables[0].Clear(); AdvData.Clear(); return(""); } return(AdvanceID); }
private bool BindPage() { try { if (SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["Is_FEECHARGING_CARD"].ToString() != "0") { SkyComm.ShowMessageInfo("该卡是非储值卡,不能进行交款!"); return(false); } InHosRecordFacade theInHosRecordFacade = new InHosRecordFacade(); InHosData = theInHosRecordFacade.FindInfoByDiagnoseID(SkyComm.DiagnoseID); _diagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); if (InHosData != null && InHosData.Tables.Count != 0 && InHosData.Tables[0].Rows.Count != 0) { DataRow drInHos = InHosData.Tables[0].Rows[0]; if (drInHos["INHOSSTATE"].ToString() == "1") { SkyComm.ShowMessageInfo("您的住院费用已经结算,不能进行预交款操作"); return(false); } this.lblPatient.Text = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString(); this.lblSex.Text = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString(); this.lblAge.Text = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGE"].ToString() + SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGEUNIT"].ToString(); this.lblIDCard.Text = "身份证号:" + SkyComm.ConvertIdCard(SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["IDENTITYCARD"].ToString()); _inHosID = drInHos["INHOSID"].ToString(); _inHosOfficeID = drInHos["INHOSOFFICEID"].ToString(); this.lblInHosID.Text = "住院号:" + _inHosID; this.lblZyYe.Text = Convert.ToDecimal(drInHos["BALANCEMONEY"].ToString()).ToString("0.00##"); SkyComm.GetCardBalance(); this.lblMzYe.Text = SkyComm.cardBlance.ToString(); this.lblhm.Text = SkyComm.cardBlance.ToString(); this.lblhm.ForeColor = System.Drawing.Color.Red; return(true); } else { SkyComm.ShowMessageInfo("未找到您的住院信息,点击关闭后返回!"); return(false); } } catch (Exception ex) { SkyComm.ShowMessageInfo("未找到您的住院信息,点击关闭后返回!"); return(false); } }
private void lblOK_Click(object sender, EventArgs e) { this.ucTime1.timer1.Stop(); SkyComm.GetCardBalance(); this.lblMzYe.Text = SkyComm.cardBlance.ToString(); if (!checkData()) { this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } FrmYesNoAlert frmAlert = new FrmYesNoAlert(); frmAlert.Title = "提示"; frmAlert.Msg = "是否确认将门诊预交金转至住院预交金,转账金额:" + Convert.ToDecimal(this.lblhm.Text.Trim()).ToString("0.00##") + "元"; if (frmAlert.ShowDialog() == DialogResult.OK) { string advanceID = Postprepay(); if (string.IsNullOrEmpty(advanceID)) { this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } SkyComm.ShowMessageInfo("转账成功!转账金额:" + Convert.ToDecimal(this.lblhm.Text.Trim()).ToString("0.00##") + "元。住院预交金余额:" + this.lblZyYe.Text + "元"); AdvanceRecordFacade theAdvanceRecordFacade = new AdvanceRecordFacade(); string receiptID = theAdvanceRecordFacade.GetReceiptIDByAdvanceID(advanceID); PrintInfo("住院预交金充值凭证", receiptID, this.lblhm.Text, advanceID); } else { this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } DialogResult = System.Windows.Forms.DialogResult.OK; }
private void lblOK_Click(object sender, EventArgs e) { bool isAll = false; for (int i = 0; i < this.gdvMain.RowCount; i++) { if ((Boolean)gdvMain.GetDataRow(i)["PITCHON1"]) { isAll = true; } } if (isAll) { #region CLINICMtQueueFacade queueFacade = new CLINICMtQueueFacade(); CLINICMtQueueData queue = new CLINICMtQueueData(); queue = queueFacade.GetByReserveID(tempeserveid); if (!string.IsNullOrEmpty(queue.Exitnooff)) { #region reserveFacade = new CLINICMtReserveFacade(); DataSet ds = reserveFacade.ReserveRecipeToGroup(tempID, tempNO); if (ds.Tables[0].Rows.Count > 0) { sourceGroupID = ds.Tables[0].Rows[0]["GROUPID"].ToString(); sourceGroupName = ds.Tables[0].Rows[0]["GROUPNAME"].ToString(); sourceOfficeID = ds.Tables[0].Rows[0]["OFFICEID"].ToString(); } if (!SelectItem(sourceOfficeID)) { ucTime1.timer1.Start(); return; } ucTime1.timer1.Stop(); using (FrmReserveInfo frm = new FrmReserveInfo()) { frm.isupdatereserve = true; //是否修改 frm.reserveOldTime = tempTime; //预约时间 frm.streserveid = tempeserveid; frm.stregisterid = tempregisterid; frm.GroupID = sourceGroupID; frm.GroupName = sourceGroupName; frm.OfficeID = sourceOfficeID; frm.CostMoney = string.Format("{0:0.00}", ReturnTotalMoney(sourceOfficeID)); frm.exOfficeName = dtRecipe.Rows[0]["OFFICEID"].ToString(); if (dtRev.Rows.Count == 0) { SkyComm.ShowMessageInfo("请选择处方信息后再进行预约!"); ucTime1.timer1.Start(); return; } else { frm.dtRev = dtRev; frm.DiagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); if (frm.ShowDialog(this) == DialogResult.OK) { using (FrmReserveAlert frmAlert = new FrmReserveAlert()) { frmAlert.reserveDate = frm.reserveDateNew; frmAlert.GroupName = sourceGroupName; frmAlert.queueNO = frm.queueNO; frmAlert.CostMoney = frm.CostMoney; frmAlert.queueNO = frm.QueueID; frmAlert.ShowDialog(); } for (int i = this.dtRecipe.Rows.Count - 1; i >= 0; i--) { if ((Boolean)dtRecipe.Rows[i]["PITCHON1"]) { dtRecipe.Rows.RemoveAt(i); } } //清空预约组信息 sourceGroupID = ""; sourceGroupName = ""; SelectAllRecipe(false); gdcMain.DataSource = null; this.gdcMain.DataSource = dtRecipe; // frm.Dispose(); if (dtRecipe.Rows.Count == 0) { ucTime1.timer1.Stop(); SkyComm.CloseWin(this); } SkyComm.GetCardBalance(); // lblYE.Text = SkyComm.cardBlance.ToString(); } else { ucTime1.timer1.Start(); return; } } } #endregion } else { SkyComm.ShowMessageInfo("您好:当前预约数据需要去窗口进行改签,谢谢。"); } #endregion } else { SkyComm.ShowMessageInfo("您好:请选择预约改签项目,谢谢。"); } }
private void lblOk_Click(object sender, EventArgs e) { try { if (Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date == DateTime.Now.Date) //如果预约时间为当天,则调用挂号方法,重新组织数据 { if (registerInfoData.Tables.Count > 0 && registerInfoData.Tables[0].Rows.Count > 0) { registerInfoData.Tables[0].Rows.Clear(); } DataRow rowReg = registerInfoData.Tables[0].NewRow(); int i = registerInfoData.Tables[0].Rows.Count + 1; rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERID] = "新增" + i.ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_CANCELMARK] = "0"; rowReg[RegisterInfoData.T_REGISTER_INFO_OPERATORID] = SysOperatorInfo.OperatorID; rowReg[RegisterInfoData.T_REGISTER_INFO_OPERATEDATE] = new CommonFacade().GetServerDateTime(); rowReg[RegisterInfoData.T_REGISTER_INFO_CHARGEMARK] = 0; rowReg[RegisterInfoData.T_REGISTER_INFO_PATIENTNAME] = patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_SEX] = patientData.Tables[0].Rows[0]["SEX"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTEROFFICEID] = BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_OFFICE] = BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICENAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERCLASS] = REGISTERCLASS; rowReg[RegisterInfoData.T_REGISTER_INFO_DOCTORID] = BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_USERNAME] = BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORNAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_CASECOST] = Gbf; rowReg[RegisterInfoData.T_REGISTER_INFO_BESPEAKMONEY] = 0;//预约费 rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERFEE] = Ghf; rowReg[RegisterInfoData.T_REGISTER_INFO_CARDID] = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_EXAMINEMONEY] = Zj; rowReg[RegisterInfoData.T_REGISTER_INFO_BESPEAKID] = ""; rowReg[RegisterInfoData.T_REGISTER_INFO_DIAGNOSEID] = SkyComm.DiagnoseID; rowReg[RegisterInfoData.T_REGISTER_INFO_AGE] = patientData.Tables[0].Rows[0]["AGE"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_AGEUNIT] = patientData.Tables[0].Rows[0]["AGEUNIT"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_ADDRESS] = patientData.Tables[0].Rows[0]["ADDRESS"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_TELEPHONE] = patientData.Tables[0].Rows[0]["TELEPHONE"].ToString(); OfficeFacade officeFacade = new OfficeFacade(); DataSet officeSet = officeFacade.QueryByOfficeType(26, ""); DataRow officeRow = officeSet.Tables[0].AsEnumerable().FirstOrDefault(o => o.Field <string>("OFFICEID") == BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()); rowReg[RegisterInfoData.T_REGISTER_INFO_OFFICEADDRESS] = officeRow["OFFICEADDRESS"].ToString().Trim(); rowReg[RegisterInfoData.T_REGISTER_INFO_DIAGNOSESTATE] = 0; rowReg[RegisterInfoData.T_REGISTER_INFO_CHECKFEE] = jcf; rowReg[RegisterInfoData.T_REGISTER_INFO_WORKTYPE] = BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_ARRANAGERECORDID] = BespeakDataset.Tables[0].Rows[0]["ARRANAGERECORDID"].ToString(); //if (SystemInfo.SystemConfigs["是否启用分时预约"] != null && SystemInfo.SystemConfigs["是否启用分时预约"].DefaultValue == "1") //{ rowReg[RegisterInfoData.T_REGISTER_INFO_QUEUEID] = BespeakDataset.Tables[0].Rows[0]["QUEUEID"].ToString(); //} rowReg[RegisterInfoData.T_REGISTER_INFO_BIRTHDAY] = patientData.Tables[0].Rows[0]["BIRTHDAY"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_EXECDATE] = new CommonFacade().GetServerDateTime(); rowReg["BESPEAKDATE"] = Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()); rowReg["BESPEAKMODE"] = ""; decimal decMoney = Convert.ToDecimal(Ghf) + Convert.ToDecimal(Zj) + Convert.ToDecimal(Gbf) + Convert.ToDecimal(jcf); rowReg["CASHDEFRAY"] = decMoney; rowReg["ACCOUNTDEFRAY"] = 0; rowReg["DISCOUNTDEFRAY"] = 0; rowReg["BALANCEMARK"] = 2; rowReg["BALANCESTATE"] = 0; rowReg["BALANCESTATE"] = 0; rowReg["BALANCEMODE"] = "预交金";//结算方式 registerInfoData.Tables[0].Rows.Add(rowReg); bespeakFac = new BespeakRegisterFacade(); //ZHOUHU ADD 20180130 CASE:29222 string isRegContr = new OfficeFacade().FindByOfficeID(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()).Tables[0].Rows[0]["ISREGCONTR"].ToString(); //chenqiang 2017-03-09 add by Case:27423 if ("1" == SystemInfo.SystemConfigs["挂号、预约限制条件"].DefaultValue && isRegContr == "1") { if (registerFacade.FindNowDateRegisterInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date, patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString()) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,当天已有预约信息,系统不允许挂号"); registerInfo.ShowDialog(); return; } } //chenqiang 2017.06.16 add by Case:28088 if (registerFacade.FindNowDateRegisterInfo(registerInfoData.Tables[0].Rows[0]["DOCTORID"].ToString(), registerInfoData.Tables[0].Rows[0]["REGISTEROFFICEID"].ToString(), registerInfoData.Tables[0].Rows[0]["WORKTYPE"].ToString(), registerInfoData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), Convert.ToDateTime(registerInfoData.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(registerInfoData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), registerInfoData.Tables[0].Rows[0]["DOCTORID"].ToString(), registerInfoData.Tables[0].Rows[0]["REGISTEROFFICEID"].ToString(), registerInfoData.Tables[0].Rows[0]["WORKTYPE"].ToString(), Convert.ToDateTime(registerInfoData.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } string ss = SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString(); DataSet ds = this.registerFacade.insertEntityForFZBD(this.registerInfoData); MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "挂号成功!"); frmAlter.ShowDialog(); //输出挂号凭证 if (null == ds.Tables[0].Columns["EXAMINENAME"]) { DataColumn col = new DataColumn("EXAMINENAME", typeof(System.String)); col.Caption = "EXAMINENAME"; ds.Tables[0].Columns.Add(col); } if (!ds.Tables[0].Columns.Contains("EXAMINELOC")) { ds.Tables[0].Columns.Add("EXAMINELOC"); } UsersFacade uf = new UsersFacade(); foreach (DataRow row in ds.Tables[0].Rows) { string keyval = row["DOCTORID"].ToString(); if (keyval != "-1") { row["EXAMINENAME"] = uf.FindByUserInfo(keyval).Tables[0].Rows[0]["EXAMINENAME"].ToString(); } ExamineFacade ef = new ExamineFacade(); string i_EXAMINENAME = uf.FindByPrimaryKeyString(keyval).ToString(); if (i_EXAMINENAME == "") { row["EXAMINELOC"] = ""; } else { DataRow[] rw = ef.FindAllExamine().Tables[0].Select("EXAMINENAME = '" + i_EXAMINENAME + "' AND OFFICEID = '" + row["REGISTEROFFICEID"].ToString() + "'"); if (rw.Length > 0) { row["EXAMINELOC"] = rw[0]["EXAMINELOC"].ToString(); } else { row["EXAMINELOC"] = ""; } } } SkyComm.GetCardBalance(); PrintReport(ds, "自助挂号"); // PrintTriageInfo(ds.Tables[0], theServerTime); } else { DataRow dr = BespeakDataset.Tables[0].Rows[0]; dr["PATIENTNAME"] = patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString(); dr["TELEPHONE"] = patientData.Tables[0].Rows[0]["TELEPHONE"].ToString(); dr["IDENTITYCARD"] = patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(); dr["SEX"] = patientData.Tables[0].Rows[0]["SEX"].ToString(); //判断是否已经预约 DataSet dsBespeak = new DataSet(); if (!string.IsNullOrEmpty(patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString())) { dsBespeak = bespeakFac.FindBespeakInfoByIdentityOrDiagnoseId(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), "", patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); } else { dsBespeak = bespeakFac.FindBespeakInfoByIdentityOrDiagnoseId(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), "", patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), ""); } if (Convert.ToInt16(dsBespeak.Tables[0].Rows[0][0]) > 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).ToShortDateString() + "已有预约信息,不能再次预约!"); frm.ShowDialog(); return; } //ZHOUHU ADD 20180130 CASE:29222 string isRegContr = new OfficeFacade().FindByOfficeID(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()).Tables[0].Rows[0]["ISREGCONTR"].ToString(); //chenqiang 2017-03-09 add by Case:27423 if ("1" == SystemInfo.SystemConfigs["挂号、预约限制条件"].DefaultValue && isRegContr == "1") { bespeakFac = new BespeakRegisterFacade(); if (registerFacade.FindNowDateRegisterInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date, patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString()) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,当天已有预约信息,系统不允许挂号"); registerInfo.ShowDialog(); return; } } //chenqiang 2017.06.16 add by Case:28088 if (registerFacade.FindNowDateRegisterInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } //chenqiang add by case:33511 if (SystemInfo.SystemConfigs["是否启用号源云平台接口"].DefaultValue != "0") { if (BespeakDataset.Tables[0].Rows.Count > 1) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "在启用号源接口时,同一次只能预约一个医生!"); registerInfo.ShowDialog(); return; } } BespeakDataset = (BespeakRegisterData)bespeakFac.insertBespeakEntityReturn(BespeakDataset, patientData, 1); //chenqiang add by case:33511 if (SystemInfo.SystemConfigs["是否启用号源云平台接口"].DefaultValue != "0") { if (arrangeSource == "1" && Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date != new CommonFacade().GetServerDateTime().Date) { RegisterClouldInterface theRegisterClouldInterface = new RegisterClouldInterface(); int intResult = theRegisterClouldInterface.BespeakRegisteInfo(BespeakDataset); if (intResult < 0) { bespeakFac.CancelBespeak(BespeakDataset.Tables[0].Rows[0]["BESPEAKID"].ToString()); return; } } } MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "预约成功!"); frmAlter.ShowDialog(); PrintReport(BespeakDataset, "自助预约"); //预约成功后,发短信 try { Hashtable htPara = new Hashtable(); htPara.Add("@预约时间", Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"]).ToString("MM月dd日HH时mm分")); string OfficeAddress = SysOperatorInfo.OperatorAreaname + BespeakDataset.Tables[0].Rows[0]["OFFICEADDRESS"].ToString(); htPara.Add("@科室位置", OfficeAddress); htPara.Add("@科室", BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICENAME"].ToString()); htPara.Add("@医生", BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORNAME"].ToString()); htPara.Add("@排队号", BespeakDataset.Tables[0].Rows[0]["QUEUEID"].ToString()); htPara.Add("@预约号", BespeakDataset.Tables[0].Rows[0]["BESPEAKID"].ToString()); UMSMsgLib.UMSMsg.Instance.SendMsg(BespeakDataset.Tables[0].Rows[0]["TELEPHONE"].ToString(), "预约挂号", htPara); } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("预约成功后,发短信失败!" + ex.Message); } } SkyComm.CloseWin(this); } catch (Exception ex) { MyAlert frm = new MyAlert(AlertTypeenum.信息, ex.Message); frm.ShowDialog(); } }
private void lblOK_Click(object sender, EventArgs e) { this.AnsyWorker(ui => { ui.UpdateTitle("正在缴费中,请稍等..."); ui.SynUpdateUI(() => { #region 验证缴费处方信息 DataTable dtMain = dsRecipe.Tables[0].DefaultView.ToTable(); IEnumerable <string> _CLINICRECIPEIDs = dtMain.AsEnumerable().Where(b => b.Field <bool>("PITCHON1") == true).Select(a => a.Field <string>("CLINICRECIPEID")).Distinct(); if (_CLINICRECIPEIDs.Count() == 0) { SkyComm.ShowMessageInfo("请选择要缴费的处方!"); return; } this.ucTime1.timer1.Stop(); //选中处方的金额 decimal sumMoney = DecimalRound.Round(Convert.ToDecimal(dtMain.Compute("SUM(TOTALMONEY)", "PITCHON1 = true")), 2); ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade(); DataSet dsTemp = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID, string.Empty, "3"); DataSet ds = dsTemp.Clone(); foreach (DataRow row in dsTemp.Tables[0].Rows) { if (_CLINICRECIPEIDs.Contains(row["CLINICRECIPEID"].ToString())) { ds.Tables[0].ImportRow(row); } } if (ds.Tables[0].Rows.Count < 1) { SkyComm.ShowMessageInfo("没有找到可进行缴费的处方记录,请检查处方号"); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } //调用大通审方系统 if (!CheckDTPass(ds)) { return; } #endregion #region 组织缴费处方信息 CommonFacade commonFacade = new CommonFacade(); DateTime ServerTime = commonFacade.GetServerDateTime(); LeechdomCharge charge = new LeechdomCharge(SkyComm.DiagnoseID, SysOperatorInfo.OperatorID); charge.AddRecipeCharge(ds); decimal decHisMoney = DecimalRound.Round(Convert.ToDecimal(charge.detailAccountData.Tables[0].Compute("SUM(MONEY)", "")), 2); if (decHisMoney != sumMoney) { charge.detailAccountData.Clear(); charge.ecipeMedicineData.Clear(); SkyComm.ShowMessageInfo("选择的处方金额不正确,请在门诊窗口进行缴费!"); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } if (decHisMoney > SkyComm.cardBlance) { charge.detailAccountData.Clear(); charge.ecipeMedicineData.Clear(); SkyComm.ShowMessageInfo("余额不足,请先进行自助预存,再进行缴费!"); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } #endregion #region 缴费 try { //验证西北妇幼高值耗材 if (!CheckHValueMaterial(charge.detailAccountData)) { throw new Exception("缴费信息中有高值耗材,请在门诊窗口进行缴费!"); } DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); DataSet dads = detailAccountFacade.insertEntityNoInvoice(charge.detailAccountData, ref charge.ecipeMedicineData); SkyComm.GetCardBalance(); SkyComm.ShowMessageInfo("缴费成功!"); //根据“药房自动配药接口类型”配置为2时,调用西北妇幼的派昂接口 19797 string AutoDoseConfig = SystemInfo.SystemConfigs["药房自动配药接口类型"].DefaultValue; string strCK = string.Empty; if (AutoDoseConfig == "2" && charge.ecipeMedicineData.Tables[0].Rows.Count > 0) { strCK = UploadAngPaiData(dads, charge.ecipeMedicineData, dsTemp); } PrintReport(dads, strCK, dsRecipe);//打印交费凭证 } catch (Exception err) { charge.detailAccountData.Clear(); charge.ecipeMedicineData.Clear(); Skynet.LoggingService.LogService.GlobalInfoMessage(SkyComm.DiagnoseID + "缴费失败:" + err.Message); SkyComm.ShowMessageInfo("缴费失败:" + err.Message); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } dsRecipe = GetRecipeInfo(); if (dsRecipe == null || dsRecipe.Tables[0].Rows.Count == 0) { SkyComm.CloseWin(this); } else { this.gdcMain.DataSource = dsRecipe.Tables[0].DefaultView; lblYE.Text = SkyComm.cardBlance.ToString(); refreshUI(); } #endregion }); }); }
public void NetPay(string hisno, string payMethod) { this.AnsyWorker(ui => { ui.UpdateTitle("正在缴费中,请稍等..."); ui.SynUpdateUI(() => { #region 验证缴费处方信息 DataTable dtMain = dsRecipe.Tables[0].DefaultView.ToTable(); IEnumerable <string> _CLINICRECIPEIDs = dtMain.AsEnumerable().Where(b => b.Field <bool>("PITCHON1") == true).Select(a => a.Field <string>("CLINICRECIPEID")).Distinct(); if (_CLINICRECIPEIDs.Count() == 0) { SkyComm.ShowMessageInfo("请选择要缴费的处方!"); return; } this.ucTime1.timer1.Stop(); //选中处方的金额 decimal sumMoney = DecimalRound.Round(Convert.ToDecimal(dtMain.Compute("SUM(TOTALMONEY)", "PITCHON1 = true")), 2); ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade(); DataSet dsTemp = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID, string.Empty, "3"); DataSet ds = dsTemp.Clone(); foreach (DataRow row in dsTemp.Tables[0].Rows) { if (_CLINICRECIPEIDs.Contains(row["CLINICRECIPEID"].ToString())) { ds.Tables[0].ImportRow(row); } } if (ds.Tables[0].Rows.Count < 1) { SkyComm.ShowMessageInfo("没有找到可进行缴费的处方记录,请检查处方号"); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } //调用大通审方系统 if (!CheckDTPass(ds)) { return; } #endregion #region 组织缴费处方信息 CommonFacade commonFacade = new CommonFacade(); DateTime ServerTime = commonFacade.GetServerDateTime(); LeechdomCharge charge = new LeechdomCharge(SkyComm.DiagnoseID, SysOperatorInfo.OperatorID); charge.AddRecipeCharge(ds); decimal decHisMoney = DecimalRound.Round(Convert.ToDecimal(charge.detailAccountData.Tables[0].Compute("SUM(MONEY)", "")), 2); if (decHisMoney != sumMoney) { charge.detailAccountData.Clear(); charge.ecipeMedicineData.Clear(); SkyComm.ShowMessageInfo("选择的处方金额不正确,请在门诊窗口进行缴费!"); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } #endregion #region 缴费 try { //验证西北妇幼高值耗材 if (!CheckHValueMaterial(charge.detailAccountData)) { throw new Exception("缴费信息中有高值耗材,请在门诊窗口进行缴费!"); } DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); DataSet data = new DataSet(); Hashtable hashtable = new Hashtable(); hashtable.Add("@HISSEQNO", hisno); string mSql = "SELECT * FROM T_BANKHISEXCHANGE_TRANS where HISSEQNO = @HISSEQNO";// and BANKSTATE = '1' QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); data = querySolutionFacade.ExeQuery(mSql, hashtable); TBankhisexchangeTransData transData = new TBankhisexchangeTransData(); transData.Bankseqno = data.Tables[0].Rows[0]["BANKSEQNO"].ToString(); transData.Hisseqno = data.Tables[0].Rows[0]["HISSEQNO"].ToString(); transData.Ohisseqno = data.Tables[0].Rows[0]["OHISSEQNO"].ToString(); transData.Bankstate = data.Tables[0].Rows[0]["BANKSTATE"].ToString(); transData.Hisstate = data.Tables[0].Rows[0]["HISSTATE"].ToString(); transData.Buscd = data.Tables[0].Rows[0]["BUSCD"].ToString(); transData.Hisid = data.Tables[0].Rows[0]["HISID"].ToString(); transData.Trfamt = data.Tables[0].Rows[0]["TRFAMT"].ToString(); transData.Usetype = data.Tables[0].Rows[0]["USETYPE"].ToString(); transData.Operatorid = data.Tables[0].Rows[0]["OPERATORID"].ToString(); transData.Operatetime = Convert.ToDateTime(data.Tables[0].Rows[0]["OPERATETIME"].ToString()); transData.Diagnoseid = data.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); transData.BusinessType = data.Tables[0].Rows[0]["BUSINESSTYPE"].ToString(); transData.DataSources = data.Tables[0].Rows[0]["DATASOURCES"].ToString(); transData.DataSources = data.Tables[0].Rows[0]["DATASOURCES"].ToString(); transData.RefundType = Convert.ToInt32(data.Tables[0].Rows[0]["REFUNDTYPE"].ToString()); transData.RefundMoney = Convert.ToDecimal(data.Tables[0].Rows[0]["REFUNDMONEY"].ToString()); transData.Remark = "_FromPayForRecipeForm"; foreach (DataRow Row in charge.detailAccountData.Tables[0].Rows) { Row.BeginEdit(); Row["ISBANKCARD"] = 1; Row["BALANCEMODE"] = payMethod; Row["BANKTRANSNO"] = transData.Hisseqno; Row["IS_FEECHARGING_CARD"] = "1"; Row.EndEdit(); decHisMoney += Convert.ToDecimal(Row["MONEY"]); } DataSet dads = detailAccountFacade.insertEntityNoInvoiceZZZD(charge.detailAccountData, ref charge.ecipeMedicineData, transData); //DataSet dads = detailAccountFacade.insertEntityNoInvoice(charge.detailAccountData, ref charge.ecipeMedicineData); SkyComm.GetCardBalance(); SkyComm.ShowMessageInfo("缴费成功!"); //根据“药房自动配药接口类型”配置为2时,调用西北妇幼的派昂接口 19797 string AutoDoseConfig = SystemInfo.SystemConfigs["药房自动配药接口类型"].DefaultValue; string strCK = string.Empty; if (AutoDoseConfig == "2" && charge.ecipeMedicineData.Tables[0].Rows.Count > 0) { strCK = UploadAngPaiData(dads, charge.ecipeMedicineData, dsTemp); } PrintReport(dads, strCK, dsRecipe);//打印交费凭证 } catch (Exception err) { charge.detailAccountData.Clear(); charge.ecipeMedicineData.Clear(); Skynet.LoggingService.LogService.GlobalInfoMessage(SkyComm.DiagnoseID + "缴费失败:" + err.Message); SkyComm.ShowMessageInfo("缴费失败:" + err.Message); this.ucTime1.Sec = 60; this.ucTime1.timer1.Start(); return; } dsRecipe = GetRecipeInfo(); if (dsRecipe == null || dsRecipe.Tables[0].Rows.Count == 0) { SkyComm.CloseWin(this); } else { this.gdcMain.DataSource = dsRecipe.Tables[0].DefaultView; lblYE.Text = SkyComm.cardBlance.ToString(); refreshUI(); } #endregion }); }); }
private void lblOK_Click(object sender, EventArgs e) { try { decimal ye = Convert.ToDecimal(this.lblYE.Text.Trim()); decimal costMoney = Convert.ToDecimal(this.lblTotalMoney.Text.Trim()); if (ye < costMoney) { SkyComm.ShowMessageInfo("卡余额不足!"); ucTime1.timer1.Start(); return; } } catch { } ucTime1.timer1.Stop(); using (FrmReserveInfo frm = new FrmReserveInfo()) { frm.GroupID = sourceGroupID; frm.GroupName = sourceGroupName; frm.OfficeID = OfficeID; frm.CostMoney = this.lblTotalMoney.Text; frm.exOfficeName = dtRecipe.Rows[0]["OFFICE"].ToString(); if (!SelectItem()) { ucTime1.timer1.Start(); return; } if (dtRev.Rows.Count == 0) { SkyComm.ShowMessageInfo("请选择处方信息后再进行预约!"); ucTime1.timer1.Start(); return; } else { frm.dtRev = dtRev; frm.DiagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); if (frm.ShowDialog(this) == DialogResult.OK) { using (FrmReserveAlert frmAlert = new FrmReserveAlert()) { frmAlert.reserveDate = frm.reserveDateNew; frmAlert.GroupName = sourceGroupName; frmAlert.queueNO = frm.queueNO; frmAlert.CostMoney = frm.CostMoney; frmAlert.ShowDialog(); } for (int i = this.dtRecipe.Rows.Count - 1; i >= 0; i--) { if ((Boolean)dtRecipe.Rows[i]["PITCHON1"]) { dtRecipe.Rows.RemoveAt(i); } } //清空预约组信息 sourceGroupID = ""; sourceGroupName = ""; SelectAllRecipe(false); gdcMain.DataSource = null; this.gdcMain.DataSource = dtRecipe; // frm.Dispose(); if (dtRecipe.Rows.Count == 0) { ucTime1.timer1.Stop(); SkyComm.CloseWin(this); } SkyComm.GetCardBalance(); lblYE.Text = SkyComm.cardBlance.ToString(); } else { ucTime1.timer1.Start(); return; } } } }
private void lblCashStored_Click(object sender, EventArgs e) { btnEnd.Enabled = false; WaitDialogForm form = new WaitDialogForm("正在存钞中,请稍候...", "正在组织数据,请稍候......", new Size(240, 60)); try { MoneyServer.NotAllowCashin(); //拍照,纸币器 switch (AutoHostConfig.ReadCardType) { case "XUHUI": AutoServiceSDK.SdkService.Common_XH camera = new AutoServiceSDK.SdkService.Common_XH(); camera.TakeCameraEnd(); camera.DoorLightClose(LightTypeenum.纸币器); break; default: break; } timer2.Stop(); timer1.Stop(); #region 休眠3秒以后重新获取纸币金额 Thread.Sleep(5000); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后休眠2秒重新获取存钞明细"); int InMoney = MoneyServer.GetInMoney(AutoHostConfig.Machineno, SysOperatorInfo.OperatorID); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后重新获取存钞明细金额:" + InMoney); if (InMoney > 0) { //投入数量 int intOld = Convert.ToInt32(lblAmount.Text) + 1; lblAmount.Text = intOld.ToString(); //投入金额 RechargeMoney += Convert.ToDecimal(InMoney); RechargeMoney = DecimalRound.Round(RechargeMoney, 2); lblMoney.Text = RechargeMoney.ToString(); } #endregion if (RechargeMoney == 0) { btnClose_Click(null, null); return; } lblNoPaymentCharge.Enabled = true; ucTime1.timer1.Stop(); if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; ////Add money Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之前"); if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; } Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyCashMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); SkyComm.GetCardBalance(); Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); Savingsucceed = 1; if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), RechargeMoney.ToString()); } } catch (Exception ex) { SkyComm.ShowMessageInfo("存钞失败:" + ex.Message); Skynet.LoggingService.LogService.GlobalInfoMessage("存钞失败:" + ex.Message); } finally { MoneyServer.ClosePort(); form.Close(); form.Dispose(); btnEnd.Enabled = true; } Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = RechargeMoney; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else if (CallType == 2) { SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + RechargeMoney + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } //GetMoeny(); }
private void Saving(decimal money) { if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之前"); ////Add money if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money; //此处需调接口 } Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyPosMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = new DataSet(); POSBase Posfac = IPOSFactory.CreateIPOS(AutoHostConfig.PosInterfaceType); if (Posfac == null) { SkyComm.ShowMessageInfo("银联POS接口配置不正确,请与管理员联系!"); return; } ValidateCode vc = new ValidateCode(); string HisSeqNo = string.Empty; HisSeqNo = DateTime.Now.ToString("yyMMddHHmmss") + SysOperatorInfo.OperatorID + vc.GenValidateCode(4); Hashtable BankTranht = new Hashtable(); BankTranht.Add("SEQNO", HisSeqNo); BankTranht.Add("MONEY", money); BankTranht.Add("OPERATORID", SysOperatorInfo.OperatorCode); BankTranht.Add("POSNO", AutoHostConfig.PosNo); BankTranht.Add("DIAGNOSEID", SkyComm.DiagnoseID); BankTranht.Add("CARDID", SkyComm.cardInfoStruct.CardNo); Posfac.Trans("1", BankTranht); if (BankTranht["CARDNO"] != null) { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKCARDNO] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = BankTranht["BANKSEQNO"].ToString(); } try { //if (SkynetMessage.MsgInfo("是否要充值成功?", true) == false) //{ // throw new Exception("操作操作测试放弃充值!"); //} cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); Posfac.Trans("2", BankTranht); Savingsucceed = 1; } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS保存失败:" + ex.Message + "\r\n开始调用撤消方法"); SkynetMessage.MsgInfo("HIS充值失败,需要撤消银行交易,请按POS机提示操作!"); Posfac.Trans("-2", BankTranht); Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS失败,调用银行撤消完成!"); //SkynetMessage.MsgInfo("HIS充值失败:"+ex.Message); return; } SkyComm.GetCardBalance(); if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), money.ToString()); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = money; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + money + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } } else { DialogResult = System.Windows.Forms.DialogResult.OK; SkyComm.CloseWin(this); } //GetMoeny(); }