private void FrmChargeDetailInquire_Load(object sender, EventArgs e) { ucTime1.Sec = 60; ucTime1.timer1.Start(); detailFacade = new DetailAccountFacade(); string sql = "SELECT TYPE,NAME,UNITPRICE,AMOUNT,SUM(SELFMONEY) SELFMONEY,INVOICEID,INVOICEDATE,OPERATEDATE FROM (" + " SELECT CASE CLE.RECIPETYPE WHEN '检查' THEN '检查费' WHEN '药品费' THEN '药品费' WHEN '中草药' THEN '药品费' WHEN '附加' THEN '检查费' WHEN '化验' THEN '检查费' ELSE '其他' END TYPE,SM.MEDORDNAME NAME,CLE.UNITPRICE,CLE.AMOUNT,SUM(DDA.SELFMONEY) SELFMONEY,CASE WHEN DDA.INVOICEID LIKE 'k%' THEN '' ELSE DDA.INVOICEID END INVOICEID,DDA.INVOICEDATE,DDA.OPERATEDATE" + " FROM (SELECT N.CLINICRECIPEID,N.RECIPECONTENT,N.DIAGNOSEID,N.RECIPETYPE,N.UNITPRICE,N.RECIPESTATE,SUM(N.AMOUNT) AS AMOUNT FROM CLINICPHYSICIANRECIPE N WHERE N.DIAGNOSEID=@DIAGNOSEID GROUP BY N.RECIPETYPE,N.UNITPRICE,N.RECIPECONTENT,N.DIAGNOSEID,N.RECIPESTATE,N.CLINICRECIPEID) as CLE,S_MEDORD_MAIN SM,D_DETAIL_ACCOUNT DDA" + " WHERE CLE.RECIPECONTENT=SM.MEDORDID AND CLE.RECIPETYPE<>'附加' AND CLE.RECIPESTATE=1 AND DDA.CLINICRECIPEID IS NOT NULL" + " AND CLE.CLINICRECIPEID=DDA.CLINICRECIPEID AND CLE.DIAGNOSEID=DDA.DIAGNOSEID AND CLE.RECIPECONTENT=DDA.UNITECODE " + " AND CLE.DIAGNOSEID=@DIAGNOSEID" + " GROUP BY CLE.RECIPETYPE,SM.MEDORDNAME,CLE.UNITPRICE,CLE.AMOUNT,DDA.INVOICEID,DDA.INVOICEDATE,DDA.OPERATEDATE" + " ) as tempTable group by TYPE,NAME,UNITPRICE,AMOUNT,INVOICEID,INVOICEDATE,OPERATEDATE " + " UNION ALL" + " SELECT CASE CLE.RECIPETYPE WHEN '检查' THEN '检查费' WHEN '药品费' THEN '药品费' WHEN '中草药' THEN '药品费' WHEN '附加' THEN '检查费' WHEN '化验' THEN '检查费' ELSE '其他' END TYPE,DS.CHARGEITEM NAME,CLE.UNITPRICE,CLE.AMOUNT,DDA.SELFMONEY,CASE WHEN DDA.INVOICEID LIKE 'k%' THEN '' ELSE DDA.INVOICEID END INVOICEID,DDA.INVOICEDATE,DDA.OPERATEDATE " + " FROM CLINICPHYSICIANRECIPE CLE,D_SUMMARY_INFO DS,D_DETAIL_ACCOUNT DDA" + " WHERE CLE.RECIPECONTENT=DS.ITEMID AND CLE.RECIPETYPE='附加' AND CLE.RECIPESTATE=1 AND DDA.CLINICRECIPEID IS NOT NULL" + " AND CLE.CLINICRECIPEID=DDA.CLINICRECIPEID AND CLE.DIAGNOSEID=DDA.DIAGNOSEID AND CLE.RECIPECONTENT=DDA.ITEMID " + " AND CLE.DIAGNOSEID=@DIAGNOSEID" + " UNION ALL" + " SELECT DS.SUMMARY TYPE, DS.CHARGEITEM NAME,DS.UNITPRICE,DDA.AMOUNT,DDA.SELFMONEY,CASE WHEN DDA.INVOICEID LIKE 'k%' THEN '' ELSE DDA.INVOICEID END INVOICEID,DDA.INVOICEDATE,DDA.OPERATEDATE" + " FROM D_SUMMARY_INFO DS,D_DETAIL_ACCOUNT DDA" + " WHERE DDA.CLINICRECIPEID IS NULL AND DDA.ITEMID=DS.ITEMID AND DDA.ITEMID<>'01' AND DDA.ITEMID<>'02' AND DDA.ITEMID<>'03' AND DDA.ITEMID<>'04'" + " AND DDA.DIAGNOSEID =@DIAGNOSEID" + " UNION ALL" + " SELECT '药品费' TYPE,TC.CURRENCYNAME NAME ,DEM.UNITPRICE,DEM.AMOUNT,DEM.TOTALMONEY SELFMONEY,CASE WHEN DDA.INVOICEID LIKE 'k%' THEN '' ELSE DDA.INVOICEID END INVOICEID,DDA.INVOICEDATE,DDA.OPERATEDATE" + " FROM D_ECIPE_MEDICINE DEM,T_CODEX TC,T_CODEX_DETAIL TCD,D_DETAIL_ACCOUNT DDA" + " WHERE DEM.LEECHDOMNO = TCD.LEECHDOMDETAILNO AND TC.LEECHDOMNO=TCD.LEECHDOMNO AND DEM.CANCELMARK=0 AND DEM.DIAGNOSEID=DDA.DIAGNOSEID AND DEM.DETAILACCOUNTID=DDA.DETAILACCOUNTID" + " AND DEM.DIAGNOSEID =@DIAGNOSEID" + " UNION ALL" + " SELECT DISTINCT '挂号费' as TYPE,A.REGISTERCLASS AS NAME,(a.CASHDEFRAY+a.ACCOUNTDEFRAY+a.DISCOUNTDEFRAY) as UNITPRICE, " + " 1.00 as AMOUNT,(a.CASHDEFRAY+a.ACCOUNTDEFRAY+a.DISCOUNTDEFRAY) as SELFMONEY,A.INVOICEID,A.INVOICEDATE, A.OPERATEDATE " + " from T_REGISTER_INFO A WHERE a.CANCELMARK = 0 AND A.DIAGNOSEID=@DIAGNOSEID"; Hashtable ht = new Hashtable(); ht.Add("@DIAGNOSEID", SkyComm.DiagnoseID); ds = query.ExeQuery(sql, ht); //ds = detailFacade.GetAllDetailInfo(SkyComm.DiagnoseID); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gdcMain.DataSource = mChargeDetailInquirePresenter.getNewDetailInfo(ds).Tables[0]; // gdcMain.DataSource = ds.Tables[0]; } else { gdcMain.DataSource = null; } }
public string GetStartTime() { QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); string mechinNo = string.Empty; #region 获取ip string ipAddress = null; try { string hostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostEntry(hostName); for (int i = 0; i < ipEntry.AddressList.Length; i++) { if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork) { ipAddress = ipEntry.AddressList[i].ToString(); } } } catch (Exception ex) { } #endregion #region 获取机器码 string sql1 = "select * from T_AUTOSERVICEMACHINE_INFO where IPADDRESS = @IPADDRESS"; Hashtable hashtable1 = new Hashtable(); hashtable1.Add("@IPADDRESS", ipAddress); DataSet dataSet = querySolutionFacade.ExeQuery(sql1, hashtable1); if (dataSet.Tables[0].Rows.Count > 0) { mechinNo = dataSet.Tables[0].Rows[0]["MACHINENO"].ToString(); } string MBeginTime = DateTime.Now.ToLocalTime().ToString();; string MEndTime = DateTime.Now.ToLocalTime().ToString();; string sql3 = "select * from SETTLEMENT_TIME where M_NO = @M_NO"; Hashtable hashtable3 = new Hashtable(); hashtable3.Add("@M_NO", mechinNo); DataSet dataSet3 = querySolutionFacade.ExeQuery(sql3, hashtable3); if (dataSet3.Tables[0].Rows.Count > 0) { MBeginTime = dataSet3.Tables[0].Rows[0]["TIMES"].ToString(); } return(MBeginTime); #endregion }
public DataSet getNewDetailInfo(DataSet dataSet) { DetailAccountFacade mDetailAccountFacade = new DetailAccountFacade(); foreach (DataRow dataRow in dataSet.Tables[0].Rows) { string mType = dataRow["TYPE"].ToString(); if (mType.Equals("检查费")) { decimal mMoney = Convert.ToDecimal(dataRow["UNITPRICE"].ToString()); decimal count = Convert.ToDecimal(dataRow["AMOUNT"].ToString()); decimal mSelfMoney = Convert.ToDecimal(dataRow["SELFMONEY"].ToString()); decimal mTotalMoney = mMoney * count; if (mTotalMoney != mSelfMoney) { dataRow["AMOUNT"] = mSelfMoney / mMoney; } } } return(dataSet); }
private void btnBalance_Click(object sender, EventArgs e) { QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); string mechinNo = string.Empty; try { #region 获取ip string ipAddress = null; try { string hostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostEntry(hostName); for (int i = 0; i < ipEntry.AddressList.Length; i++) { if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork) { ipAddress = ipEntry.AddressList[i].ToString(); } } } catch (Exception ex) { SkyComm.ShowMessageInfo(ex.Message); return; } #endregion #region 获取机器码 string sql1 = "select * from T_AUTOSERVICEMACHINE_INFO where IPADDRESS = @IPADDRESS"; Hashtable hashtable1 = new Hashtable(); hashtable1.Add("@IPADDRESS", ipAddress); DataSet dataSet = querySolutionFacade.ExeQuery(sql1, hashtable1); if (dataSet.Tables[0].Rows.Count > 0) { mechinNo = dataSet.Tables[0].Rows[0]["MACHINENO"].ToString(); } #endregion #region 判断结算 Hashtable hashtablejs = new Hashtable(); string sqljs = "select * from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1' hashtablejs.Add("@MECHINNO", mechinNo); DataSet dataSet1 = querySolutionFacade.ExeQuery(sqljs, hashtablejs); if (dataSet1.Tables[0].Rows.Count > 0) { if (dataSet1.Tables[0].Rows[0]["SETTLEMENT_TIME"].ToString().Equals(DateTime.Now.ToString("yyyy-MM-dd"))) { SkyComm.ShowMessageInfo("此台机器已经结算过"); return; } else { } } #endregion #region 获取结算时间 string MBeginTime = DateTime.Now.ToLocalTime().ToString();; string MEndTime = DateTime.Now.ToLocalTime().ToString();; string sql3 = "select * from SETTLEMENT_TIME where M_NO = @M_NO"; Hashtable hashtable3 = new Hashtable(); hashtable3.Add("@M_NO", mechinNo); DataSet dataSet3 = querySolutionFacade.ExeQuery(sql3, hashtable3); if (dataSet3.Tables[0].Rows.Count > 0) { MBeginTime = dataSet3.Tables[0].Rows[0]["TIMES"].ToString(); } #endregion #region 获取现金记录 string sql2 = "select * from T_AUTOINMONEY_RECORD where MACHINENO = @MACHINENO and OPERATORTIME between @starttime and @endtime"; Hashtable hashtable2 = new Hashtable(); hashtable2.Add("@MACHINENO", mechinNo); hashtable2.Add("@starttime", MBeginTime); hashtable2.Add("@endtime", MEndTime); DataSet dataSet2 = querySolutionFacade.ExeQuery(sql2, hashtable2); if (dataSet2.Tables[0].Rows.Count == 0) { SkyComm.ShowMessageInfo("此台机器没有结算信息,已经记录结算时间"); } else { dataSet2.WriteXml(Application.StartupPath + @"\\ReportXml\\自助机结算.xml"); string path = Application.StartupPath + @"\\Reports\\自助机结算.frx"; PrintManager print = new PrintManager(); print.InitReport("自助机结算"); print.AddParam("结算时间", DateTime.Now.ToLocalTime().ToString()); print.AddData(dataSet2.Tables[0], "report"); PrintManager.CanDesign = true; print.Print(); print.Dispose(); } #endregion } catch (Exception e1) { SkyComm.ShowMessageInfo(e1.Message); return; } #region 记录结算 DataSet data = new DataSet(); Hashtable hashtable = new Hashtable(); string mSql = "delete from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1' hashtable.Add("@MECHINNO", mechinNo); querySolutionFacade.ExeNonQuery(mSql, hashtable); string sql = "insert into SETTLEMENT_RECORD values (@SETTLEMENT_TIME,'已结算',@MECHINNO);"; hashtable.Add("@SETTLEMENT_TIME", DateTime.Now.ToString("yyyy-MM-dd")); data = querySolutionFacade.ExeQuery(sql, hashtable); #endregion #region 记录结算时间 string sql4 = "delete from SETTLEMENT_TIME where M_NO = @M_NO"; Hashtable hashtable4 = new Hashtable(); hashtable4.Add("@M_NO", mechinNo); int a = querySolutionFacade.ExeNonQuery(sql4, hashtable4); string sql5 = "insert into SETTLEMENT_TIME values (@TIMES,@M_NO)"; Hashtable hashtable5 = new Hashtable(); hashtable5.Add("@TIMES", DateTime.Now.ToLocalTime().ToString()); hashtable5.Add("@M_NO", mechinNo); int b = querySolutionFacade.ExeNonQuery(sql5, hashtable5); #endregion SkyComm.ShowMessageInfo("现金结算成功"); //_mSquareAccountsPresenter = new SquareAccountsPresenter(this); //_mSquareAccountsPresenter.GetSquareAccount(); }
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 FrmCardSavingMain_Load(object sender, EventArgs e) { string mechinNo = string.Empty; try { QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade(); DetailAccountFacade detailAccountFacade = new DetailAccountFacade(); #region 获取ip string ipAddress = null; try { string hostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostEntry(hostName); for (int i = 0; i < ipEntry.AddressList.Length; i++) { if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork) { ipAddress = ipEntry.AddressList[i].ToString(); } } } catch (Exception ex) { } #endregion #region 获取机器码 string sql1 = "select MACHINENO from T_AUTOSERVICEMACHINE_INFO where IPADDRESS = @IPADDRESS"; Hashtable hashtable1 = new Hashtable(); hashtable1.Add("@IPADDRESS", ipAddress); DataSet dataSet = querySolutionFacade.ExeQuery(sql1, hashtable1); if (dataSet.Tables[0].Rows.Count > 0) { mechinNo = dataSet.Tables[0].Rows[0]["MACHINENO"].ToString(); } #endregion #region 记录结算时间 DataSet data = new DataSet(); Hashtable hashtable = new Hashtable(); string mSql = "select * from SETTLEMENT_RECORD where MECHINNO = @MECHINNO "; hashtable.Add("@MECHINNO", mechinNo); data = querySolutionFacade.ExeQuery(mSql, hashtable); if (data.Tables[0].Rows.Count > 0) { if (data.Tables[0].Rows[0]["SETTLEMENT_TIME"].ToString().Equals(DateTime.Now.ToString("yyyy-MM-dd"))) { this.lblCashStored.Enabled = false; } else { this.lblCashStored.Enabled = true; } } else { this.lblCashStored.Enabled = true; } #endregion } catch (Exception) { this.lblCashStored.Enabled = true; } //if (!string.IsNullOrEmpty(SkyComm.getvalue("禁用现金"))) //{ // lblCashStored.Visible = false; // btnWxPay.Location = new Point(142, 332); //} if (!string.IsNullOrEmpty(SkyComm.getvalue("禁用银行卡"))) { lblBankCardStored.Visible = false; } if (!string.IsNullOrEmpty(SkyComm.getvalue("禁用微信"))) { btnWxPay.Visible = false; } ucTime1.Sec = 60; ucTime1.timer1.Start(); }
private void lblClinicEmrPrint_Click(object sender, EventArgs e) { try { this.ucTime1.timer1.Stop(); if (false == System.IO.File.Exists(Application.StartupPath + @"\\Reports\\门诊费用清单.frx")) { SkyComm.ShowMessageInfo("系统没有找到报表文件“门诊费用清单.frx”!"); return; } this.AnsyWorker(ui => { ui.UpdateTitle("正在准备数据,请稍等..."); ui.SynUpdateUI(() => { #region 查询列表 string[] Condition = { "", "", "", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), "", "", "" }; DetailAccountFacade facade = new DetailAccountFacade(); DateTime dtStart = Convert.ToDateTime("2016-01-01"); DateTime dtEnd = Convert.ToDateTime("2016-10-11"); DataSet ds = facade.QueryPatientPayList(Condition, dtStart, dtEnd); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { row["MONEY"] = decimal.Round(decimal.Parse(row["MONEY"].ToString()), 2); } } #endregion if (ds == null || ds.Tables[0].Rows.Count == 0) { SkyComm.ShowMessageInfo("所选时间段内未找到门诊费用信息!"); return; } ui.UpdateTitle("正在打印,请稍等..."); ds.WriteXml(Application.StartupPath + @"\\ReportXml\\门诊费用清单.xml"); PrintManager print = new PrintManager(); print.InitReport("门诊费用清单"); print.AddData(ds.Tables[0], "report"); Hashtable MedType = new Hashtable(); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["MEDICARETYPE"].ToString().Trim() != string.Empty) { if (MedType.ContainsKey("医保" + dr["MEDICARETYPE"].ToString()) == false) { MedType.Add("医保" + dr["MEDICARETYPE"].ToString(), Convert.ToDecimal(dr["MONEY"])); } else { MedType["医保" + dr["MEDICARETYPE"].ToString()] = Convert.ToDecimal(MedType["医保" + dr["MEDICARETYPE"].ToString()]) + Convert.ToDecimal(dr["MONEY"]); } } if (dr["NMEDICARETYPE"].ToString().Trim() != string.Empty) { if (MedType.ContainsKey("农保" + dr["NMEDICARETYPE"].ToString()) == false) { MedType.Add("农保" + dr["NMEDICARETYPE"].ToString(), Convert.ToDecimal(dr["MONEY"])); } else { MedType["农保" + dr["NMEDICARETYPE"].ToString()] = Convert.ToDecimal(MedType["农保" + dr["NMEDICARETYPE"].ToString()]) + Convert.ToDecimal(dr["MONEY"]); } } } foreach (DictionaryEntry de in MedType) { print.AddParam(de.Key.ToString(), de.Value.ToString()); } PrintManager.CanDesign = true; //print.PreView(); print.Print(); print.Dispose(); Thread.Sleep(100); }); }); } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("门诊费用清单打印异常:" + ex.Message); } finally { ucTime1.Sec = 60; ucTime1.timer1.Start(); } }