Пример #1
0
        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
        }
        private DataSet GetAdvanceRecord()
        {
            try
            {
                string sql = " SELECT H_ADVANCE_RECORD.*,H_CHARGE_TYPE.CHARGETYPE AS PAYMODE, T_PATIENT_INFO.PATIENTNAME ,T_OPERATOR.OPERATORNAME" +
                             " FROM H_ADVANCE_RECORD,H_CHARGE_TYPE ,H_INHOS_RECORD,T_PATIENT_INFO,T_OPERATOR" +
                             " WHERE H_ADVANCE_RECORD.PAYMODEID = H_CHARGE_TYPE.CHARGETYPEID " +
                             " AND H_ADVANCE_RECORD.INHOSID = H_INHOS_RECORD.INHOSID " +
                             " AND H_INHOS_RECORD.DIAGNOSEID = T_PATIENT_INFO.DIAGNOSEID " +
                             " AND H_ADVANCE_RECORD.OPERATORID = T_OPERATOR.OPERATORID " +
                             " AND H_ADVANCE_RECORD.INHOSID = @INHOSID " +
                             " ORDER BY OPERATEDATE";

                Hashtable htm = new Hashtable();
                htm.Add("@INHOSID", _inHosID);
                QuerySolutionFacade facadem   = new QuerySolutionFacade();
                DataSet             dsAdvance = facadem.ExeQuery(sql, htm);
                return(dsAdvance);
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalErrorMessage("调用住院预交金充值记录查询失败,原因:" + ex.Message);
                return(null);
            }
        }
Пример #3
0
 private bool CheckInHosSaving()
 {
     try
     {
         string    sql  = "SELECT ID,STARTNUMBER,CURRNUMBER,ENDNUMBER,SURPLUSNUMBER FROM T_OPERATOR_INVOICE WHERE INVOICETYPE=:INVOICETYPE  AND OPERATORID=:OPERATORID AND SURPLUSNUMBER>'0'  AND CURRNUMBER<=ENDNUMBER   ORDER BY ID";
         Hashtable para = new Hashtable();
         para.Add(":INVOICETYPE", "预交款发票");
         para.Add(":OPERATORID", SysOperatorInfo.OperatorID);
         QuerySolutionFacade facadem   = new QuerySolutionFacade();
         DataSet             dsAdvance = facadem.ExeQuery(sql, para);
         if (dsAdvance == null || dsAdvance.Tables.Count == 0 || dsAdvance.Tables[0].Rows.Count == 0)
         {
             SkyComm.ShowMessageInfo("该自助机无可用发票,请到其他自助机进行预存操作!");
             return(false);
         }
         Int64 currnumber = Convert.ToInt64(dsAdvance.Tables[0].Rows[0]["CURRNUMBER"]);
         if (currnumber > Convert.ToInt64(dsAdvance.Tables[0].Rows[0]["ENDNUMBER"]))
         {
             SkyComm.ShowMessageInfo("该自助机已无可用发票,请到其他自助机进行预存操作!");
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         Skynet.LoggingService.LogService.GlobalErrorMessage("检测是否可进行住院预存方法调用失败,原因:" + ex.Message);
         SkyComm.ShowMessageInfo("该自助机暂无法进行住院预存操作,请到其他自助机进行住院预存!");
         return(false);
     }
 }
        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 DataSet getPayType(string id)
        {
            string    sql     = "SELECT * FROM H_CHARGE_TYPE a where a.CHARGETYPEID = @CHARGETYPEID";
            DataSet   dataSet = new DataSet();
            Hashtable ht      = new Hashtable();

            ht.Add("@CHARGETYPEID", id);

            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            return(querySolutionFacade.ExeQuery(sql, ht));
        }
        public DataSet getBankInfo(string id, string HisSeqNo)
        {
            string    sql     = "SELECT * FROM T_BANKHISEXCHANGE_TRANS a where a.DIAGNOSEID = @HISID and a.HISSEQNO = @HISSEQNO";
            DataSet   dataSet = new DataSet();
            Hashtable ht      = new Hashtable();

            ht.Add("@HISID", id);
            ht.Add("@HISSEQNO", HisSeqNo);
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            return(querySolutionFacade.ExeQuery(sql, ht));
        }
        public string getType(string id)
        {
            string    sql     = "SELECT * FROM S_CHARGE_KIND a where a.CHARGEKINDID = @CHARGEKINDID";
            DataSet   dataSet = new DataSet();
            Hashtable ht      = new Hashtable();

            ht.Add("@CHARGEKINDID", id);
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            dataSet = querySolutionFacade.ExeQuery(sql, ht);

            return(dataSet.Tables[0].Rows[0]["CHARGEKIND"].ToString());
        }
        /// <summary>
        /// 查询检验中间表,查询患者检验报告信息
        /// </summary>
        /// <returns></returns>
        private DataTable GetListData()
        {
            try
            {
                DataTable dtAllReport = this.CreateDataTable();
                #region 查询杏和LIS数据
                StringBuilder sb = new StringBuilder();
                sb.Append("select distinct OUTPATIENT_ID,REQUISITION_ID,TEST_ORDER_NAME,SAMPLING_TIME from HIS_INSPECTION_SAMPLE left outer join T_PRINT_RECORD tp on HIS_INSPECTION_SAMPLE.REQUISITION_ID=tp.PRINTBUSINESSID where PATIENT_TYPE='2'and OUTPATIENT_ID=@OUTPATIENT_ID AND ( SAMPLING_TIME IS NOT NULL OR SAMPLING_TIME<>'') AND LENGTH(SAMPLING_TIME)>6 AND TP.PRINTCOUNT IS NULL");

                Hashtable ht1 = new Hashtable();
                ht1.Add("@OUTPATIENT_ID", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString());
                QuerySolutionFacade facade1 = new QuerySolutionFacade();
                DataSet             ds1     = facade1.ExeQuery(sb.ToString(), ht1);

                if (ds1 != null && ds1.Tables.Count != 0 && ds1.Tables[0].Rows.Count != 0)
                {
                    for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                    {
                        string ora_startDate = new CommonFacade().GetServerDateTime().AddMonths(-3).ToString("yyyy-MM-dd 00:00:00");

                        if (ds1.Tables[0].Rows[i]["SAMPLING_TIME"].ToString().Trim() != "")
                        {
                            DateTime samplingTime = Convert.ToDateTime(ds1.Tables[0].Rows[i]["SAMPLING_TIME"].ToString().Trim().Replace("@", ":"));
                            ds1.Tables[0].Rows[i]["SAMPLING_TIME"] = samplingTime.ToString("yyyy-MM-dd HH:mm:ss");

                            if (samplingTime <= Convert.ToDateTime(ora_startDate))
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                        object[] obj = new object[dtAllReport.Columns.Count];
                        ds1.Tables[0].Rows[i].ItemArray.CopyTo(obj, 0);
                        dtAllReport.Rows.Add(obj);
                    }
                }
                #endregion

                return(dtAllReport);
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalErrorMessage("查询检验结果报表失败,原因:" + ex.Message);
                return(null);
            }
        }
        public string getOfficeName(string id)
        {
            DataSet dataSet = new DataSet();

            string sql = "select * from T_OFFICE a where a.OFFICEID = @OFFICEID";

            Hashtable ht = new Hashtable();

            ht.Add("@OFFICEID", id);
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            dataSet = querySolutionFacade.ExeQuery(sql, ht);

            return(dataSet.Tables[0].Rows[0]["OFFICE"].ToString());
        }
Пример #10
0
        public DataSet getPayResult(string hisSerialNo)
        {
            DataSet data = new DataSet();

            Hashtable hashtable = new Hashtable();

            hashtable.Add("@HISSEQNO", hisSerialNo);

            string mSql = "SELECT * FROM T_BANKHISEXCHANGE_TRANS where HISSEQNO = @HISSEQNO";// and BANKSTATE = '1'

            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            data = querySolutionFacade.ExeQuery(mSql, hashtable);

            return(data);
        }
Пример #11
0
        public string getOfficeId(string officeName)
        {
            string mSql = "SELECT* FROM T_OFFICE a where a.OFFICE = @OFFICE and a.MEDICALCODE = @MEDICALCODE";


            DataSet mDataSet = new DataSet();

            Hashtable ht = new Hashtable();

            ht.Add("@OFFICE", officeName);
            ht.Add("@MEDICALCODE", SkyComm.getvalue("MedicalCode"));
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            mDataSet = querySolutionFacade.ExeQuery(mSql, ht);

            return(mDataSet.Tables[0].Rows[0]["OFFICEID"].ToString());
        }
Пример #12
0
        public DataSet getWindowIdSend(string dignoseID)
        {
            string mSql  = " select DISTINCT D_ECIPE_MEDICINE.DIAGNOSEID,T_PATIENT_INFO.PATIENTNAME,D_ECIPE_MEDICINE.OPERATEDATE , P_DOSAGE.WINDOWID,P_DOSAGE.PHARMACYID,P_PHARMACYWINDOW.PHARMARYWINDOWID,P_PHARMACYWINDOW.WINDOWNAME\r\nfrom P_DOSAGE,D_ECIPE_MEDICINE,T_PATIENT_INFO,T_OFFICE,T_USERS,P_PHARMACYWINDOW where D_ECIPE_MEDICINE.OPERATEDATE>@OPERATEDATE and P_DOSAGE.DOSAGESTATE= 0 AND P_DOSAGE.DETAILACCOUNTID = D_ECIPE_MEDICINE.DETAILACCOUNTID  AND  CANCELMARK = 0 AND SENDLEECHDOMMARK = 0 AND D_ECIPE_MEDICINE.DIAGNOSEID = T_PATIENT_INFO.DIAGNOSEID AND REGISTEROFFICEID = T_OFFICE.OFFICEID AND DOCTORID = USERID AND P_DOSAGE.MEDICALCODE  = D_ECIPE_MEDICINE.MEDICALCODE AND D_ECIPE_MEDICINE.MEDICALCODE =T_PATIENT_INFO.MEDICALCODE AND T_PATIENT_INFO.MEDICALCODE =T_OFFICE.MEDICALCODE AND T_OFFICE.MEDICALCODE =T_USERS.MEDICALCODE  AND T_USERS.MEDICALCODE = @MEDICALCODE and P_PHARMACYWINDOW.WINDOWTYPE = '发药' and  P_DOSAGE.PHARMACYID = P_PHARMACYWINDOW.PHARMACYID and P_DOSAGE.WINDOWID = P_PHARMACYWINDOW.WINDOWID ";
            string start = DateTime.Now.ToString("yyyy-MM-dd ") + " 00:00:00";

            DataSet mDataSet = new DataSet();

            Hashtable ht = new Hashtable();

            ht.Add("@OPERATEDATE", Convert.ToDecimal(start));
            ht.Add("@MEDICALCODE", SkyComm.getvalue("MedicalCode"));
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            mDataSet = querySolutionFacade.ExeQuery(mSql, ht);

            return(mDataSet);
        }
Пример #13
0
        public int getArrayCount(string officeID, string windowId)
        {
            string mSql = "SELECT * FROM P_DOSAGECOMPLETE where P_DOSAGECOMPLETE.PHARMACYID = @PHARMACYID and P_DOSAGECOMPLETE.PHARMARYWINDOWID = @PHARMARYWINDOWID and P_DOSAGECOMPLETE.MEDICALCODE = @MEDICALCODE";


            DataSet mDataSet = new DataSet();

            Hashtable ht = new Hashtable();

            ht.Add("@PHARMACYID", officeID);
            ht.Add("@PHARMARYWINDOWID", windowId);
            ht.Add("@MEDICALCODE", SkyComm.getvalue("MedicalCode"));
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

            mDataSet = querySolutionFacade.ExeQuery(mSql, ht);

            return(mDataSet.Tables[0].Rows.Count);
        }
        private DataSet GetRegisterIDInfo()
        {
            try
            {

                DateTime dtEnd = Convert.ToDateTime(new CommonFacade().GetServerDateTime().AddMonths(-3).ToString("yyyy-MM-dd 00:00:00"));

                string sql = "SELECT REGISTERID FROM T_REGISTER_INFO WHERE DIAGNOSEID=@DIAGNOSEID AND OPERATEDATE>=@ENDTIME";

                Hashtable htm = new Hashtable();
                htm.Add("@DIAGNOSEID", _diagnoseID);
                htm.Add("@ENDTIME", dtEnd);
                QuerySolutionFacade facadem = new QuerySolutionFacade();
                DataSet dsRegister = facadem.ExeQuery(sql, htm);
                return dsRegister;
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalErrorMessage("获取患者挂号信息失败,原因:" + ex.Message);
                return null;
            }
        }
Пример #15
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            string eCardNo = string.Empty;

            if (!string.IsNullOrEmpty(textBox_ecard.Text.ToString()))
            {
                eCardNo = textBox_ecard.Text.ToString().Split(':')[0].ToString();
            }
            string    sql1      = "select * from t_card_authorization where VICECARDID = @VICECARDID and CIRCUIT_STATE = 0";
            Hashtable hashtable = new Hashtable();

            hashtable.Add("@VICECARDID", eCardNo);
            DataSet dataSet = query.ExeQuery(sql1, hashtable);

            if (dataSet.Tables[0].Rows.Count > 0)
            {
                string cardNo = dataSet.Tables[0].Rows[0]["CARDID"].ToString();
                SkyComm.cardInfoStruct.CardNo  = cardNo;
                SkyComm.DiagnoseID             = dataSet.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                SkyComm.eCardAuthorizationData = (CardAuthorizationData)theCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo);
                this.DialogResult = DialogResult.OK;
            }
        }
Пример #16
0
        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();
        }
Пример #17
0
        private void lblOK_Click(object sender, EventArgs e)
        {
            if (lbltel.Text.Length != 11)
            {
                lblErr.Text    = "手机号长度必须是11位!";
                lblErr.Visible = true;
                return;
            }


            this.lblOK.Enabled     = false;
            this.btnReturn.Enabled = false;
            this.btnExit.Enabled   = false;
            panel2.Enabled         = false;
            _telphone = this.lbltel.Text.Trim();
            string CardNo = string.Empty;

            CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade();


            try
            {
                isHadCard = false;
                cardNub   = string.Empty;
                string cardType, cardTypeId;
                HealthCardInfoStruct Entity = new HealthCardInfoStruct();
                if (!cardRegulation(out cardType, out cardTypeId))//电子卡注册签约条件判断
                {
                    return;
                }

                #region 卡管平台电子卡注册

                HealthCardBase _healthcardBase = HealthCardBase.CreateEhealthCardInstance(this);

                HealthCardInfoStruct patientInfo = new HealthCardInfoStruct();
                patientInfo.XM   = IdInfo.Name;
                patientInfo.XB   = IdInfo.Sex;
                patientInfo.LXDH = _telphone;
                patientInfo.CSRQ = IdInfo.Birthday;
                patientInfo.SFZH = IdInfo.Number;
                patientInfo.DZ   = IdInfo.Address;
                patientInfo.MZ   = IdInfo.People;

                Entity = _healthcardBase.registerEHC(patientInfo);



                #endregion

                #region  HIS业务机制处理
                PatientInfoFacade pfacade      = new PatientInfoFacade();
                string            ConditionStr = cardType == "0" ? " AND A.IDENTITYCARD='" + IdInfo.Number + "' " : " AND A.GUARDIANIDNUMBER='" + IdInfo.Number + "' ";
                ConditionStr += " AND A.PATIENTNAME='" + IdInfo.Name + "'  ORDER BY  A.DIAGNOSEID DESC ";
                DataSet dsState = pfacade.FindCardPatientinfoByCondition(ConditionStr);
                if (dsState != null && dsState.Tables[0].Rows.Count > 0)
                {
                    strDiagnoseid = dsState.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                }
                virtualCardId = Entity.ehealthCardId;


                if (string.IsNullOrEmpty(strDiagnoseid))
                {
                    BindHis(virtualCardId);
                    eCardAuthorizationFacade.updateViceCardIdByCardId(IdInfo.Number, virtualCardId);//根据卡号修改电子健康卡号
                }
                else
                {
                    string    sql = "select * from t_card_authorization where DIAGNOSEID = @DIAGNOSEID and CIRCUIT_STATE = 0 and CARDID = @CARDID and TYPEID = 3";
                    Hashtable ht  = new Hashtable();
                    ht.Add("@DIAGNOSEID", strDiagnoseid);
                    ht.Add("@CARDID", IdInfo.Number);
                    DataSet dataSet = query.ExeQuery(sql, ht);
                    if (dataSet.Tables[0].Rows.Count > 0)
                    {
                        bool flag = true;
                        foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                        {
                            if (!string.IsNullOrEmpty(dataRow["VICECARDID"].ToString()))
                            {
                                flag = false;
                                string    sql1      = "update t_card_authorization set VICECARDID = @VICECARDID where ACCOUNT_ID = @ACCOUNT_ID";
                                Hashtable hashtable = new Hashtable();
                                hashtable.Add("@ACCOUNT_ID", dataRow["ACCOUNT_ID"].ToString());
                                hashtable.Add("@VICECARDID", virtualCardId);
                                query.ExeQuery(sql1, hashtable);
                            }
                        }

                        if (flag)
                        {
                            BindHis(virtualCardId);
                            eCardAuthorizationFacade.updateViceCardIdByCardId(IdInfo.Number, virtualCardId);//根据卡号修改电子健康卡号
                        }
                    }
                    else
                    {
                        BindHis(virtualCardId);
                        eCardAuthorizationFacade.updateViceCardIdByCardId(IdInfo.Number, virtualCardId);//根据卡号修改电子健康卡号
                    }
                }



                if (eLCardAuthorizationData != null)
                {
                    cardNub = eLCardAuthorizationData.Tables[0].Rows.Count > 0 ? eLCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString() : "";
                }


                if (strDiagnoseid != "")
                {
                    //eCardAuthorizationFacade.updateViceCardIdByCardId(cardNub, virtualCardId);//根据卡号修改电子健康卡号
                }
                printVirtualCard(Entity);//打印二维码
                #endregion
            }
            catch (Exception ex)
            {
                SkynetMessage.MsgInfo(ex.Message);
            }



            DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Пример #18
0
        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
                });
            });
        }
Пример #19
0
        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();
        }
        /// <summary>
        /// 获取卡余额
        /// </summary>
        private void GetMoeny()
        {
            //获取诊疗号
            string diagnoseId = SkyComm.DiagnoseID;

            //预交金
            if (eCardSavingFacade == null)
            {
                eCardSavingFacade = new CardSavingFacade();
            }

            string yje = string.Empty;

            if (SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString() != "2")
            {
                yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID(diagnoseId).ToString("0.00");
            }
            else
            {
                yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID_New(diagnoseId, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["ACCOUNT_ID"].ToString()).ToString("0.00");
            }
            //门诊未结
            //string wj = eCardAuthorizationFacade.FindClinicNoCheckoutMoney(diagnoseId).ToString("0.00");

            //门诊未缴费
            #region 查询未缴费的金额
            QuerySolutionFacade query = new QuerySolutionFacade();
            Hashtable           ht    = new Hashtable();
            string wj     = "0.00";
            string strsql = " SELECT COALESCE(SUM(TOTALMONEY),0) TOTALMONEY FROM (" +
                            " select SUM(C.TOTALMONEY) TOTALMONEY" +
                            " from CLINICPHYSICIANRECIPE C" +
                            " where C.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 and OPERATETIME >= :YPDATE " +
                            " AND C.RECIPETYPE IN ('药品费','中草药','医材')" +
                            " union all " +
                            " SELECT SUM(D_SUMMARY_INFO.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT * S_MEDORD_DETAIL.AMOUNT) AS TOTALMONEY" +
                            " FROM CLINICPHYSICIANRECIPE,D_SUMMARY_INFO,S_MEDORD_DETAIL,S_MEDORD_MAIN " +
                            " WHERE CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_DETAIL.MEDORDID AND S_MEDORD_DETAIL.ITEMID = D_SUMMARY_INFO.ITEMID AND" +
                            "  CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" +
                            "  CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加'  AND CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_MAIN.MEDORDID " +
                            "  AND OPERATETIME >=:JZFDATE AND (ISCHANGEPRICE<> 1 OR ISCHANGEPRICE IS NULL)" +
                            " union all " +
                            " SELECT SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) AS TOTALMONEY" +
                            " FROM CLINICPHYSICIANRECIPE " +
                            " WHERE CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" +
                            "  CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加' " +
                            "  AND OPERATETIME >=:JZFDATE AND ISCHANGEPRICE = 1" +
                            " union all  " +
                            " select SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) TOTALMONEY" +
                            " from CLINICPHYSICIANRECIPE  " +
                            " where  RECIPESTATE = 0  AND CLINICPHYSICIANRECIPE.RECIPETYPE = '附加' " +
                            "  AND CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID and OPERATETIME >=:JZFDATE ) AA ";

            string ypDate  = SystemInfo.SystemConfigs["药品处方有效期"].DefaultValue;
            string jzfDate = SystemInfo.SystemConfigs["检治费处方有效期"].DefaultValue;

            CommonFacade commonFacade = new CommonFacade();
            DateTime     dtCurrent    = commonFacade.GetServerDateTime();

            ht.Add(":DIAGNOSEID", diagnoseId);
            ht.Add(":YPDATE", dtCurrent.Date.AddDays(Convert.ToInt32(ypDate) * -1));
            ht.Add(":JZFDATE", dtCurrent.Date.AddDays(Convert.ToInt32(jzfDate) * -1));

            try
            {
                lblNoPaymentCharge.Visible = false;
                decimal decNoCharge = 0;
                DataSet ds          = query.ExeQuery(strsql, ht);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    decNoCharge = DecimalRound.Round(Convert.ToDecimal(ds.Tables[0].Rows[0]["TOTALMONEY"]), 2);
                }
                wj          = decNoCharge.ToString();
                lblwjf.Text = decNoCharge.ToString();

                if (decNoCharge != 0)
                {
                    lblNoPaymentCharge.Visible = true;
                }
                else
                {
                    lblNoPaymentCharge.Visible = false;
                }
            }
            catch (Exception ex)
            {
                SkynetMessage.MsgInfo("获取未交费信息出错:" + ex.Message);
            }

            #endregion

            lblwjf.Text = wj + "元";
            //余额
            lblye.Text = SkyComm.cardBlance.ToString();
        }
        /// <summary>
        /// 查询检验中间表,查询患者检验报告信息
        /// </summary>
        /// <returns></returns>
        private DataTable GetListData()
        {
            try
            {
                DataTable dtAllReport = GreateDataTable();
                DateTime dtEnd =Convert.ToDateTime( new CommonFacade().GetServerDateTime().AddMonths(-3).ToString("yyyy-MM-dd 00:00:00"));

                if (!string.IsNullOrEmpty(_inHosID))
                {
                    string sql = "SELECT CHECK_NO,PATIENT_ID,FilePath,FileName,FileOrder,ItemName,LastOpTime,CrudFlag FROM LIS_REPORTFILE WHERE PATIENT_ID=@INHOSID AND LastOpTime >=@ENDTIME AND CrudFlag=1 AND PRINTCOUNT=0 ORDER BY LastOpTime ASC,FileOrder ASC";
                    Hashtable htm = new Hashtable();
                    htm.Add("@INHOSID", _inHosID);
                    htm.Add("@ENDTIME", dtEnd);
                    QuerySolutionFacade facadem = new QuerySolutionFacade();
                    DataSet dsReport = facadem.ExeQuery(sql, htm);
                    if (dsReport != null && dsReport.Tables.Count != 0 && dsReport.Tables[0].Rows.Count != 0)
                    {
                        object[] obj = new object[dtAllReport.Columns.Count];

                        for (int i = 0; i < dsReport.Tables[0].Rows.Count; i++)
                        {
                            dsReport.Tables[0].Rows[i].ItemArray.CopyTo(obj, 0);
                            dtAllReport.Rows.Add(obj);
                        }
                    }
                }
                DataSet dsRegister = this.GetRegisterIDInfo();
                if (dsRegister != null && dsRegister.Tables.Count != 0 && dsRegister.Tables[0].Rows.Count != 0)
                {
                    foreach (DataRow drRegister in dsRegister.Tables[0].Rows)
                    {
                        string registerID = drRegister["REGISTERID"].ToString();

                        string sql = "SELECT CHECK_NO,PATIENT_ID,FilePath,FileName,FileOrder,ItemName,LastOpTime,CrudFlag FROM LIS_REPORTFILE WHERE PATIENT_ID=@DIAGNOSEID AND CrudFlag=1 AND PRINTCOUNT=0 ORDER BY LastOpTime ASC,FileOrder ASC";
                        Hashtable htm = new Hashtable();
                        htm.Add("@DIAGNOSEID", registerID);
                        //htm.Add("@ENDTIME", dtEnd);
                        QuerySolutionFacade facadem = new QuerySolutionFacade();
                        DataSet dsReport = facadem.ExeQuery(sql, htm);
                        if (dsReport != null && dsReport.Tables.Count != 0 && dsReport.Tables[0].Rows.Count != 0)
                        {
                            object[] obj = new object[dtAllReport.Columns.Count];

                            for (int i = 0; i < dsReport.Tables[0].Rows.Count; i++)
                            {
                                DateTime samplingTime = Convert.ToDateTime(dsReport.Tables[0].Rows[i]["LASTOPTIME"].ToString().Trim().Replace("@", ":"));
                                if (samplingTime <= Convert.ToDateTime(dtEnd))
                                    continue;

                                dsReport.Tables[0].Rows[i].ItemArray.CopyTo(obj, 0);
                                dtAllReport.Rows.Add(obj);
                            }
                        }
                    }
                }
                return dtAllReport;
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalErrorMessage("查询检验结果报表失败,原因:" + ex.Message);
                return null;
            }
        }