Ejemplo n.º 1
0
        public long GetSysSetting(System.Security.Principal.IPrincipal p_objPrincipal, string p_setId, out string p_setStatus)
        {
            long lngRes = 0;

            string strSQL;

            strSQL = @"SELECT SETSTATUS_INT FROM T_SYS_SETTING WHERE SETID_CHR = '" + p_setId + "'";

            System.Data.DataTable dtbResult = new System.Data.DataTable();

            p_setStatus = "0";
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = 0;
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtbResult);
                objHRPSvc.Dispose();

                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    p_setStatus = dtbResult.Rows[0][0].ToString().Trim();
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 2
0
        private string GetNextNewId()
        {
            long lngRes = 0;

            string strSQL;

            strSQL = @"SELECT SEQ_PREPAYBALANCE.NEXTVAL FROM dual";

            System.Data.DataTable dtbResult = new System.Data.DataTable();

            string newId = "0";

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult);
                objHRPSvc.Dispose();

                if (lngRes > 0 && dtbResult != null)
                {
                    newId = dtbResult.Rows[0][0].ToString().Trim();
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(newId);
        }
Ejemplo n.º 3
0
        public string m_lngGetMaxId()
        {
            DataTable m_dtb = null;

            try
            {
                string             strSql     = "select max(storagerackid_chr) as maxId from t_ms_storagerackset";
                clsHRPTableService objHRPServ = new clsHRPTableService();
                long lngRes = objHRPServ.lngGetDataTableWithoutParameters(strSql, ref m_dtb);

                if (m_dtb == null || m_dtb.Rows[0]["maxId"] == DBNull.Value)
                {
                    return("0001");
                }
                int    i_Id    = Convert.ToInt16(m_dtb.Rows[0]["maxId"].ToString());
                string i_maxId = Convert.ToString(i_Id + 1);
                return(i_maxId.PadLeft(4, '0'));
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(null);
        }
Ejemplo n.º 4
0
        public long GetAllRole(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            string strSQL;

            strSQL = @" SELECT ROLEID_CHR,  
                                NAME_VCHR,
                                DESC_VCHR,
                                DEPTID_CHR
                         FROM T_SYS_ROLE ORDER BY ROLEID_CHR    ";
            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtResult);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 5
0
        public long m_lngCheckIsHospital(System.Security.Principal.IPrincipal p_objPrincipal, string p_strDrugStoreID, out bool p_blnIsHospital)
        {
            p_blnIsHospital = false;
            DataTable dtbTemp = new DataTable();
            long      lngRes  = 0;

            try
            {
                string strSQL = @"select a.medstoretype_int
	from t_bse_medstore a
 where a.medstoreid_chr = ?";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objParam   = null;
                objHRPServ.CreateDatabaseParameter(1, out objParam);
                objParam[0].Value = p_strDrugStoreID;
                objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbTemp, objParam);
                if (dtbTemp != null && dtbTemp.Rows.Count > 0)
                {
                    if (Convert.ToInt16(dtbTemp.Rows[0]["medstoretype_int"]) == 2)
                    {
                        p_blnIsHospital = true;
                    }
                }
                objHRPServ.Dispose();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 6
0
        public long m_lngCheckHasAccount(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, out bool p_blnHasAccountPeriod)
        {
            p_blnHasAccountPeriod = false;
            if (string.IsNullOrEmpty(p_strStorageID))
            {
                return(-1);
            }
            DataTable dtResult = new DataTable();
            long      lngRes   = 0;

            try
            {
                string strSQL = @"select count(*) from t_ms_accountperiod a where a.storageid_chr = ?";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].Value = p_strStorageID;

                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtResult, objDPArr);
                objHRPServ.Dispose();
                objHRPServ = null;
                if (dtResult != null && dtResult.Rows.Count > 0)
                {
                    p_blnHasAccountPeriod = Convert.ToInt32(dtResult.Rows[0][0]) > 0;
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 7
0
        public long m_lngGetMedStroge(bool p_blnIsStore, out DataTable dtExp)
        {
            long   lngRes = -1;
            string strSQL = "";

            if (p_blnIsStore)
            {
                strSQL = @"select t.deptid_chr medicineroomid,t.medstorename_vchr medicineroomname from t_bse_medstore t
                            order by t.medstoreid_chr";
            }
            else
            {
                strSQL = @"select distinct t.medicineroomid medicineroomid,
                                t.medicineroomname medicineroomname
                           from t_ms_medicinestoreroomset t
                       order by t.medicineroomid ";
            }
            dtExp = new DataTable();
            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtExp);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 获取一个序列号
        /// </summary>
        /// <param name="p_objPrincipal"></param>
        /// <param name="p_strSeqName"></param>
        /// <param name="p_lngSeqId"></param>
        /// <returns></returns>
        public static long m_lngGetSequence(string p_strSeqName, out long p_lngSeqId)
        {
            p_lngSeqId = 0;
            long lngRes = 0;

            if (string.IsNullOrEmpty(p_strSeqName))
            {
                return(lngRes);
            }
            try
            {
                if (clsHRPTableService.bytDatabase_Selector == (byte)clsHRPTableService.enumDatabase_Selector.bytOracle)
                {
                    string             strSQL     = "select " + p_strSeqName + ".nextval from dual";
                    clsHRPTableService objHRPServ = new clsHRPTableService();

                    DataTable dtResult = null;
                    lngRes = objHRPServ.DoGetDataTable(strSQL, ref dtResult);
                    if (dtResult != null && dtResult.Rows.Count == 1)
                    {
                        p_lngSeqId = Convert.ToInt64(dtResult.Rows[0][0]);
                    }
                    else
                    {
                        p_lngSeqId = 1;
                    }
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogDetailError(objEx, true);
            }
            return(lngRes);
        }
Ejemplo n.º 9
0
        public long m_lngGetExptypeAndVendor(bool p_blnForDrugStore, out DataTable dtExp, out DataTable dtVendor, out DataTable dtMedType)
        {
            long lngRes = -1;

            dtExp     = null;
            dtVendor  = null;
            dtMedType = null;
            string strSQL = "";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = this.m_lngGetMedStroge(p_blnForDrugStore, out dtExp);

                strSQL = @"select t.vendorid_chr id, t.vendorname_vchr name, t.usercode_chr code,t.pycode_chr,t.wbcode_chr   
    from t_bse_vendor t where vendortype_int = 2 or vendortype_int = 3 order by t.usercode_chr ";
                lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtVendor);

                lngRes = this.m_lngGetMedType(p_blnForDrugStore, out dtMedType);

                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 10
0
        public long m_lngGetItemID(string p_strMedicineID, out string p_strItemID)
        {
            p_strItemID = string.Empty;
            long      lngRes    = -1;
            DataTable p_dtbTemp = null;

            string strSQL = @"select a.itemid_chr from t_bse_chargeitem a where a.itemsrcid_vchr = ?";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   ParamArr  = null;
                objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                ParamArr[0].Value = p_strMedicineID;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref p_dtbTemp, ParamArr);
                if (p_dtbTemp != null && p_dtbTemp.Rows.Count > 0)
                {
                    p_strItemID = p_dtbTemp.Rows[0][0].ToString();
                }
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Ejemplo n.º 11
0
        public long m_lngGetTableMedicineList(ref DataTable p_dtMedicineList)
        {
            long lngRes = -1;

            string strSQL = @"select a.itemid_chr,
                                     a.itemcode_vchr,
                                     a.itempycode_chr,
                                     a.itemwbcode_chr,
                                     a.itemname_vchr,
                                     a.itemcommname_vchr,
                                     a.itemengname_vchr
                                from t_bse_chargeitem a, t_bse_medicine b
                               where a.itemsrcid_vchr = b.medicineid_chr
                                 and b.multiunitflag_int = 1
                                 and a.ifstop_int = 0";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtMedicineList);
                int x = p_dtMedicineList.Rows.Count;
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 12
0
//        public  DateTime m_dtmGetServerDate()
//        {
//            long lngRes = 0;
//            System.DateTime datResult = System.DateTime.Now;

//            string strSQL = @"select sysdate
//                              from dual";
//            System.Data.DataTable dtbResult = new System.Data.DataTable();
//            try
//            {
//                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
//                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult);


//                if (lngRes > 0 && dtbResult != null)
//                {
//                    datResult = System.DateTime.Parse(dtbResult.Rows[0]["sysdate"].ToString());

//                }
//                objHRPSvc.Dispose();
//            }
//            catch (Exception objEx)
//            {
//                string strTmp = objEx.Message;
//                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
//                bool blnRes = objLogger.LogError(objEx);
//            }
//            return datResult;
//        }
        public string m_dtmGetServerDate()
        {
            long lngRes = 0;
            //System.DateTime datResult = System.DateTime.Now;
            string datResult = "";
            string strSQL    = @"select sysdate
                              from dual";

            System.Data.DataTable dtbResult = new System.Data.DataTable();
            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult);


                if (lngRes > 0 && dtbResult != null)
                {
                    datResult = dtbResult.Rows[0]["sysdate"].ToString();
                }
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(datResult);
        }
Ejemplo n.º 13
0
        public long m_lngGetBaseMedicine(System.Security.Principal.IPrincipal p_objPrincipal, string p_strAssistCode, string p_strDrugType, out DataTable p_dtbMedicine)
        {
            p_dtbMedicine = null;
            long lngRes = 0;

            if (p_strAssistCode == null)
            {
                p_strAssistCode = string.Empty;
            }

            try
            {
                string strSQL = @"select t.assistcode_chr,
       t.medicinename_vchr,
       t.medspec_vchr,
       t.opunit_chr,
       t.ipunit_chr,
       t.packqty_dec,
       t.productorid_chr,
       t.pycode_chr,
       t.wbcode_chr,
       t.medicineid_chr,
       t.ispoison_chr,
       t.ischlorpromazine2_chr,
       t.unitprice_mny,
       t.medicinetypeid_chr,
       t.tradeprice_mny,
       t.limitunitprice_mny,
       t.opchargeflg_int,
       t.ipchargeflg_int,
       t.ifstop_int,
       b.itemname_vchr as aliasname_vchr,
       b.pycode_vchr as aliaspycode_vchr,
       b.wbcode_vchr as aliaswbcode_vchr
  from t_bse_medicine t
  left join t_bse_chargeitem a on t.medicineid_chr = a.itemsrcid_vchr
  left join t_bse_itemalias_drug b on a.itemid_chr = b.itemid_chr
                                  and b.status_int = 1
                                  and b.flag_int = 1
 where t.assistcode_chr like ?
    and t.medicinetypeid_chr = ? and  t.deleted_int=0
 order by t.assistcode_chr,t.medicineid_chr";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(2, out objDPArr);
                objDPArr[0].Value = p_strAssistCode + "%";
                objDPArr[1].Value = p_strDrugType;

                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref p_dtbMedicine, objDPArr);
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 14
0
        public long GetAllApplyType(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            string strSQL;

            strSQL = @" SELECT TYPEID,  
                                TYPETEXT,
                                DELETED,
                                ORDERSEQ_INT
                         FROM AR_APPLY_TYPELIST ORDER BY ORDERSEQ_INT";
            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtResult);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 15
0
        public long m_lngCheckExistsInitialID(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, out string p_strInitialID)
        {
            p_strInitialID = string.Empty;
            long      lngRes = 0;
            DataTable dtTemp = null;
            string    strSQL = @"select initialid_chr
	from (select a.initialid_chr
					from t_ms_initial a
				 where a.storageid_chr = ?
				 order by a.seriesid_int)
 where rownum = 1";

            try
            {
                clsHRPTableService           objHRPServ = new clsHRPTableService();
                System.Data.IDataParameter[] objParm    = null;
                objHRPServ.CreateDatabaseParameter(1, out objParm);
                objParm[0].Value = p_strStorageID;
                lngRes           = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtTemp, objParm);
                objHRPServ.Dispose();
                objHRPServ = null;
                if (lngRes > 0 && dtTemp.Rows.Count == 1)
                {
                    p_strInitialID = dtTemp.Rows[0][0].ToString();
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 16
0
        public long GetOrderBookByDate(System.Security.Principal.IPrincipal p_objPrincipal, string p_beginDate, string p_endDate, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            string strSQL;

            strSQL = SQL_SELECT + @" AND a.OPERATE_DAT>to_date('" + p_beginDate + @"','YYYY-MM-DD HH24:MI:SS') 
                      AND a.OPERATE_DAT<to_date('" + p_endDate + @"','YYYY-MM-DD HH24:MI:SS') 
                      ORDER BY d2.CODE_VCHR,e.code_chr";
            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();

                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtResult);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
        public long m_lngGetMaxAccountId(System.Security.Principal.IPrincipal p_objPrincipal, out string p_strAccountId)
        {
            p_strAccountId = "";
            DataTable p_dtbVendor = new DataTable();
            long      lngRes      = 0;

            try
            {
                string strSQL = @"select max(a.accountid) accountid from t_ms_account a";

                clsHRPTableService objHRPServ = new clsHRPTableService();

                lngRes = objHRPServ.lngGetDataTableWithoutParameters(strSQL, ref p_dtbVendor);
                if (p_dtbVendor != null)
                {
                    p_strAccountId = p_dtbVendor.Rows[0]["accountid"].ToString();
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 18
0
        public long GetOrderBookById(System.Security.Principal.IPrincipal p_objPrincipal, string p_bookId, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            string strSQL;

            strSQL = SQL_SELECT + @" AND a.BOOKID_INT = " + p_bookId;


            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();

                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref p_dtResult);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 19
0
        public long GetOrderBookByAPPLYID(System.Security.Principal.IPrincipal p_objPrincipal, string APPLYID, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            string strSQL;

            strSQL = SQL_SELECT + @" AND APPLYID=?
                      ORDER BY d2.CODE_VCHR,e.code_chr";
            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
                System.Data.IDataParameter[] arrParams = null;
                objHRPSvc.CreateDatabaseParameter(1, out arrParams);
                arrParams[0].Value = APPLYID;

                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref p_dtResult, arrParams);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 20
0
        public long m_lngOutStorageDetailReport_Dept_Med(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, string p_strAskDeptID, string p_strMedicineID, DateTime p_dtmBegin, DateTime p_dtmEnd, out DataTable p_dtbOutDetail)
        {
            p_dtbOutDetail = null;
            if (string.IsNullOrEmpty(p_strStorageID) || string.IsNullOrEmpty(p_strMedicineID) || string.IsNullOrEmpty(p_strAskDeptID))
            {
                return(-1);
            }

            long lngRes = 0;

            try
            {
                string strSQL = @"select t.retailprice_int,
       t.netamount_int,
       t.opunit_chr,
       t.medspec_vchr,
       d.deptid_chr,
       d.deptname_vchr,
       b.medicinename_vchr,
       b.assistcode_chr,
       m.examdate_dat prodate
  from t_ms_outstorage_detail t,
       t_ms_outstorage        m,
       t_bse_deptdesc         d,
       t_bse_medicine         b
 where m.storageid_chr = ?
   and m.status > 1
   and m.formtype = 1
   and m.seriesid_int = t.seriesid2_int
   and t.status = 1
   and m.askdept_chr = d.deptid_chr
   and t.medicineid_chr = b.medicineid_chr
   and m.examdate_dat between ? and ?
   and t.medicineid_chr = ?
   and m.askdept_chr = ?
 order by d.deptname_vchr, m.examdate_dat";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(5, out objDPArr);
                objDPArr[0].Value  = p_strStorageID;
                objDPArr[1].DbType = DbType.DateTime;
                objDPArr[1].Value  = p_dtmBegin;
                objDPArr[2].DbType = DbType.DateTime;
                objDPArr[2].Value  = p_dtmEnd;
                objDPArr[3].Value  = p_strMedicineID;
                objDPArr[4].Value  = p_strAskDeptID;

                lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref p_dtbOutDetail, objDPArr);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 21
0
        public static long m_lngGetSequenceArr(string p_strSeqName, int p_intNumber, out long[] p_lngSeqIdArr)
        {
            p_lngSeqIdArr = null;
            long lngRes = 0;

            if (p_intNumber <= 0 || string.IsNullOrEmpty(p_strSeqName))
            {
                return(lngRes);
            }

            try
            {
                if (clsHRPTableService.bytDatabase_Selector == (byte)clsHRPTableService.enumDatabase_Selector.bytOracle)
                {
                    string strSQL = "select getseq(?,?) from dual";

                    clsHRPTableService objHRPServ = new clsHRPTableService();
                    DataTable          dtValue    = null;

                    IDataParameter[] objDPArr = null;
                    objHRPServ.CreateDatabaseParameter(2, out objDPArr);

                    objDPArr[0].Value = p_strSeqName;
                    objDPArr[1].Value = p_intNumber;

                    lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtValue, objDPArr);
                    if (lngRes > 0 && dtValue != null && dtValue.Rows.Count == 1)
                    {
                        p_lngSeqIdArr = new long[p_intNumber];
                        long m_lngSeqId = Convert.ToInt64(dtValue.Rows[0][0]);
                        for (int index = p_intNumber - 1; index >= 0; index--)
                        {
                            p_lngSeqIdArr[index] = m_lngSeqId--;
                        }
                    }
                    else
                    {
                        p_lngSeqIdArr    = new long[1];
                        p_lngSeqIdArr[0] = 1;
                    }
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogDetailError(objEx, true);
            }
            return(lngRes);
        }
Ejemplo n.º 22
0
        public long m_lngGetTableMultiUnitList(string p_strMedId, out DataTable p_dtMultiUnit)
        {
            long lngRes = -1;

            p_dtMultiUnit = null;

            string strSQL = @"select a.itemid_chr,
       a.unit_vchr,
       a.package_dec,
       case
         when a.curruseflag_int = 0 then
          '否'
         else
          '是'
       end as curruseflag_int,
       case
         when a.status_int = 0 then
          '停用'
         else
          '启用'
       end as status_int
  from t_bse_itemmultiunit_drug a, t_bse_chargeitem b
 where b.itemsrcid_vchr = ?
   and a.itemid_chr = b.itemid_chr ";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   ParamArr  = null;
                objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                ParamArr[0].Value = p_strMedId;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref p_dtMultiUnit, ParamArr);

                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(lngRes);
        }
Ejemplo n.º 23
0
        public long m_lngGetAmountBySeriesID(System.Security.Principal.IPrincipal p_objPrincipal, long p_intSeriesID, out clsDS_StorageHistory_VO p_objHistory)
        {
            p_objHistory = new clsDS_StorageHistory_VO();
            long lngRes = 0;

            try
            {
                DataTable          m_dtbTemp   = new DataTable();
                clsHRPTableService objHRPServ  = new clsHRPTableService();
                IDataParameter[]   objParamArr = null;
                string             strSQL      = @"select a.opavailablegross_num,
       a.ipavailablegross_num,
       a.opunit_chr,
       a.ipunit_chr,
       a.drugstoreid_chr,
       a.medicineid_chr
  from t_ds_storage_detail a
 where a.seriesid_int = ?";

                objHRPServ.CreateDatabaseParameter(1, out objParamArr);
                objParamArr[0].Value = p_intSeriesID;
                objHRPServ.lngGetDataTableWithParameters(strSQL, ref m_dtbTemp, objParamArr);

                if (m_dtbTemp != null && m_dtbTemp.Rows.Count > 0)
                {
                    p_objHistory.m_lngSERIESID2_INT        = p_intSeriesID;
                    p_objHistory.m_dblOPAVAILABLEGROSS_NUM = Convert.ToDouble(m_dtbTemp.Rows[0]["opavailablegross_num"]);
                    p_objHistory.m_dblIPAVAILABLEGROSS_NUM = Convert.ToDouble(m_dtbTemp.Rows[0]["ipavailablegross_num"]);
                    p_objHistory.m_strOPUNIT_CHR           = m_dtbTemp.Rows[0]["opunit_chr"].ToString();
                    p_objHistory.m_strIPUNIT_CHR           = m_dtbTemp.Rows[0]["ipunit_chr"].ToString();
                    p_objHistory.m_strDRUGSTOREID_CHR      = m_dtbTemp.Rows[0]["drugstoreid_chr"].ToString();
                    p_objHistory.m_strMEDICINEID_CHR       = m_dtbTemp.Rows[0]["medicineid_chr"].ToString();
                }

                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 24
0
        public long m_lngGetAllMedicine(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, out DataTable p_dtbMedicine)
        {
            p_dtbMedicine = null;

            long lngRes = -1;

            try
            {
                string strSQL = @"select t.medicineid_chr,t.assistcode_chr,
t.medicinename_vchr,
t.medspec_vchr,
t.opunit_chr,
t.tiptoplimit_int,
t.neaplimit_int,
sum(s.realgross_int) realgross_int,
t.pycode_chr
from t_bse_medicine t left join t_ms_storage_detail s
 on t.medicineid_chr = s.medicineid_chr
 where exists (select r.medicineroomid
          from t_ms_medicinestoreroomset r
         where r.medicinetypeid_chr = t.medicinetypeid_chr
           and r.medicineroomid = ?) and t.assistcode_chr is not null
 group by  t.medicineid_chr,t.assistcode_chr,
t.medicinename_vchr,
t.medspec_vchr,
t.opunit_chr,
t.tiptoplimit_int,
t.neaplimit_int,
t.pycode_chr
order by t.assistcode_chr";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                IDataParameter[]   objDPArr   = null;
                objHRPServ.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].Value = p_strStorageID;
                lngRes            = objHRPServ.lngGetDataTableWithParameters(strSQL, ref p_dtbMedicine, objDPArr);
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 处方信息列表
        /// </summary>
        /// <param name="m_dtbResult"></param>
        /// <param name="m_objDetailInfo"></param>
        public void m_mthlsvDetailInfo(DataTable m_dtbResult, ref List <clsRecipeDetailVO> m_objDetailInfoList)
        {
            if (m_dtbResult.Rows.Count > 0)
            {
                try
                {
                    m_objDetailInfoList = new List <clsRecipeDetailVO>();

                    clsRecipeDetailVO m_objDetailInfo;

                    DataView dv = new DataView(m_dtbResult);
                    dv.Sort     = "treatdate_dat desc";
                    m_dtbResult = dv.ToTable();

                    int iRowCount = m_dtbResult.Rows.Count;

                    for (int j2 = 0; j2 < iRowCount; j2++)
                    {
                        m_objDetailInfo = new clsRecipeDetailVO();
                        m_objDetailInfo.treatdate_dat      = Convert.ToDateTime(m_dtbResult.Rows[j2]["treatdate_dat"]).ToString("yyyy-MM-dd HH:mm");
                        m_objDetailInfo.outpatrecipeid_chr = m_dtbResult.Rows[j2]["outpatrecipeid_chr"].ToString();
                        m_objDetailInfo.patientcardid_chr  = m_dtbResult.Rows[j2]["patientcardid_chr"].ToString();
                        m_objDetailInfo.patientname        = m_dtbResult.Rows[j2]["patientname"].ToString();
                        m_objDetailInfo.invoiceno_vchr     = m_dtbResult.Rows[j2]["invoiceno_vchr"].ToString();
                        m_objDetailInfo.diagdrname         = m_dtbResult.Rows[j2]["diagdrname"].ToString();
                        m_objDetailInfo.diagdeptname       = m_dtbResult.Rows[j2]["diagdeptname"].ToString();
                        m_objDetailInfo.treatempname       = m_dtbResult.Rows[j2]["treatempname"].ToString();
                        m_objDetailInfo.sendempname        = m_dtbResult.Rows[j2]["sendempname"].ToString();
                        m_objDetailInfo.medstorename_vchr  = m_dtbResult.Rows[j2]["medstorename_vchr"].ToString();
                        m_objDetailInfo.treatwinname       = m_dtbResult.Rows[j2]["treatwinname"].ToString();
                        m_objDetailInfo.sendwinname        = m_dtbResult.Rows[j2]["sendwinname"].ToString();
                        m_objDetailInfo.sid_int            = m_dtbResult.Rows[j2]["sid_int"].ToString();
                        m_objDetailInfo.medstoreid_chr     = m_dtbResult.Rows[j2]["medstoreid_chr"].ToString();
                        m_objDetailInfoList.Add(m_objDetailInfo);
                    }
                }
                catch (Exception ex)
                {
                    com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                    bool blnRes = objLogger.LogError(ex);
                }
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 处方信息列表
        /// </summary>
        //public void m_mthSelectRecipeInfo()
        //{
        //    //if (this.m_objViewer.m_lsvTreatEmp.SelectedItems.Count == 0)
        //    //    return;

        //    //int m_strTreatIndex = this.m_objViewer.m_lsvTreatEmp.SelectedItems[0].Index;

        //    clsTreatEmpRecipeVO obj = (clsTreatEmpRecipeVO)this.m_objViewer.m_lsvTreatEmp.Items[m_strTreatIndex].Tag;

        //    List<clsRecipeDetailVO> m_objDetail = obj.m_objRecipeDetailList;

        //    try
        //    {
        //        this.m_objViewer.m_lsvRecipeInfo.Items.Clear();
        //        this.m_objViewer.m_lsvRecipeDetailInfo.Items.Clear();
        //        this.m_objViewer.m_lsvRecipeInfo.BeginUpdate();

        //        ListViewItem lsiTemp = null;

        //        for (int i1 = 0; i1 < m_objDetail.Count; i1++)
        //        {
        //            lsiTemp = new ListViewItem(m_objDetail[i1].treatdate_dat);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].outpatrecipeid_chr);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].patientcardid_chr);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].patientname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].invoiceno_vchr);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].diagdrname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].diagdeptname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].treatempname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].sendempname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].medstorename_vchr);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].treatwinname);
        //            lsiTemp.SubItems.Add(m_objDetail[i1].sendwinname);
        //            lsiTemp.Tag = m_objDetail[i1];
        //            this.m_objViewer.m_lsvRecipeInfo.Items.Add(lsiTemp);
        //        }
        //        this.m_objViewer.m_lsvRecipeInfo.EndUpdate();
        //    }
        //    catch (Exception ex)
        //    {
        //        com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
        //        bool blnRes = objLogger.LogError(ex);
        //    }
        //    if (this.m_objViewer.m_lsvRecipeInfo.Items.Count > 0)
        //    {
        //        this.m_objViewer.m_lsvRecipeInfo.Items[0].Selected = true;
        //    }
        //}
        #endregion

        #region 绑定处方明细信息数据
        /// <summary>
        /// 绑定处方明细信息数据
        /// </summary>
        /// <param name="m_dtbDetail"></param>
        private void m_mthlsvRecipeDetailData(DataTable m_dtbDetail)
        {
            if (m_dtbDetail.Rows.Count > 0)
            {
                try
                {
                    if (this.m_objViewer.m_lsvRecipeDetailInfo.Items.Count > 0)
                    {
                        this.m_objViewer.m_lsvRecipeDetailInfo.Items.Clear();
                    }
                    this.m_objViewer.m_lsvRecipeDetailInfo.BeginUpdate();
                    ListViewItem lsiTempDetail = null;

                    for (int i1 = 0; i1 < m_dtbDetail.Rows.Count; i1++)
                    {
                        /// itemname_vchr itemspec_vchr dosage_dec dosageunit_chr  usagename_vchr  freqname_chr(频率)
                        /// days_int1 qty_dec unitid_chr price_mny tolprice_mny itemcode_vchr

                        lsiTempDetail = new ListViewItem(m_dtbDetail.Rows[i1]["itemname_vchr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["itemspec_vchr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["dosage_dec"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["dosageunit_chr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["usagename_vchr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["freqname_chr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["days_int1"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["qty_dec"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["unitid_chr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["price_mny"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["tolprice_mny"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["itemcode_vchr"].ToString());
                        lsiTempDetail.SubItems.Add(m_dtbDetail.Rows[i1]["productorid_chr"].ToString());
                        this.m_objViewer.m_lsvRecipeDetailInfo.Items.Add(lsiTempDetail);
                    }
                    this.m_objViewer.m_lsvRecipeDetailInfo.EndUpdate();
                }
                catch (Exception ex)
                {
                    com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                    bool blnRes = objLogger.LogError(ex);
                }
            }
        }
Ejemplo n.º 27
0
        public long m_lngGetMedicineType(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_dtbResult)
        {
            p_dtbResult = null;
            long lngRes = 0;

            try
            {
                string strSQL = @"select medicinetypeid_chr,medicinetypename_vchr from t_aid_medicinetype";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                lngRes = objHRPServ.lngGetDataTableWithoutParameters(strSQL, ref p_dtbResult);
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 28
0
        public long GetBySearchSentence(System.Security.Principal.IPrincipal p_objPrincipal, string p_strSQL, out DataTable p_dtResult)
        {
            p_dtResult = new DataTable();

            long lngRes = -1;

            try
            {
                com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();

                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(p_strSQL, ref p_dtResult);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 29
0
        public long m_lngSaveStorageRack(System.Security.Principal.IPrincipal p_objPrincipal, Dictionary <string, string> p_dicStorageRack)
        {
            long lngRes = 0;

            try
            {
                string strSQL = @"update t_ds_storage_detail a set a.storagerackid_chr = ?
                                    where a.medicineid_chr = ? and a.lotno_vchr = ?";

                clsHRPTableService objHRPServ = new clsHRPTableService();
                DbType[]           dbTypes    = new DbType[] { DbType.String, DbType.String, DbType.String };

                object[][] objValues = new object[3][];

                int intItemCount = p_dicStorageRack.Count;
                for (int j = 0; j < objValues.Length; j++)
                {
                    objValues[j] = new object[intItemCount];//初始化
                }

                int iRow = 0;
                foreach (KeyValuePair <string, string> kvp in p_dicStorageRack)
                {
                    objValues[0][iRow] = kvp.Value;
                    objValues[1][iRow] = kvp.Key.Substring(0, 10);
                    objValues[2][iRow] = kvp.Key.Substring(10);
                    iRow++;
                }

                lngRes = objHRPServ.m_lngSaveArrayWithParameters(strSQL, objValues, dbTypes);
                objHRPServ.Dispose();
                objHRPServ = null;
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            return(lngRes);
        }
Ejemplo n.º 30
0
        public bool m_blnQueryByIndex(string strSeledMedId, string p_strUnit, int p_intPackage_Dec, int p_CurruseFlag_Int)
        {
            bool blnIsFind = false;

            string strSQL = @"select a.itemid_chr, a.unit_vchr,a.status_int
                                  from t_bse_itemmultiunit_drug a
                                 where a.itemid_chr = ?
                                   and a.unit_vchr = ?
                                   and a.package_dec = ?
                                   and a.curruseflag_int = ?";

            try
            {
                clsHRPTableService objHRPSvc = new clsHRPTableService();
                IDataParameter[]   ParamArr  = null;
                objHRPSvc.CreateDatabaseParameter(4, out ParamArr);
                ParamArr[0].Value  = strSeledMedId;
                ParamArr[1].Value  = p_strUnit;
                ParamArr[2].DbType = DbType.Int16;
                ParamArr[2].Value  = p_intPackage_Dec;
                ParamArr[3].DbType = DbType.Int16;
                ParamArr[3].Value  = p_CurruseFlag_Int;

                DataTable dtValue = new DataTable();
                long      lngRes  = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtValue, ParamArr);
                if (dtValue != null && dtValue.Rows.Count > 0)
                {
                    blnIsFind = true;
                }
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }

            return(blnIsFind);
        }