public long m_lngGetLatestAccountID(System.Security.Principal.IPrincipal p_objPrincipal, string p_strStorageID, out string p_strID) { p_strID = string.Empty; long lngRes = -1; try { string strSQL = @"select max(t.accountid_chr) from t_ds_accountperiod t where t.accountid_chr like ? and t.drugstoreid_chr = ?"; DataTable dtbValue = null; clsDS_Public_Supported_SVC clsPub = new clsDS_Public_Supported_SVC(); DateTime dtmNow = DateTime.Now; clsPub.m_lngGetCurrentDateTime(out dtmNow); clsHRPTableService objHRPServ = new clsHRPTableService(); IDataParameter[] objDPArr = null; objHRPServ.CreateDatabaseParameter(2, out objDPArr); objDPArr[0].Value = dtmNow.ToString("yyyy") + "%"; objDPArr[1].Value = p_strStorageID; lngRes = objHRPServ.lngGetDataTableWithParameters(strSQL, ref dtbValue, objDPArr); objHRPServ.Dispose(); objHRPServ = null; if (dtbValue == null || dtbValue.Rows.Count == 0) { p_strID = dtmNow.ToString("yyyy") + "01"; } else { string strTemp = dtbValue.Rows[0][0].ToString(); if (string.IsNullOrEmpty(strTemp)) { p_strID = dtmNow.ToString("yyyy") + "01"; } else { double dblID = 0d; if (double.TryParse(strTemp, out dblID)) { p_strID = (dblID + 1).ToString(); } else { return(-1); } } } } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
/// <summary> /// 获取门诊药房基本信息表 /// </summary> /// <param name="m_dtDeptDesc"></param> /// <returns></returns> public long m_lngGetDeptInfo(out DataTable m_dtDeptDesc) { long lngRes = 0; com.digitalwave.iCare.middletier.HIS.clsDS_Public_Supported_SVC objSvc = (com.digitalwave.iCare.middletier.HIS.clsDS_Public_Supported_SVC)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsDS_Public_Supported_SVC)); lngRes = objSvc.m_lngGetDeptInfo(objPrincipal, out m_dtDeptDesc); return(lngRes); }
public long m_lngAddNewAccount(System.Security.Principal.IPrincipal p_objPrincipal, clsDS_Account p_objRecord, out long p_lngSEQ) { p_lngSEQ = 0; if (p_objRecord == null) { return(-1); } long lngRes = 0; try { string strSQL = @"insert into t_ds_account (seriesid_int, accountid_chr, drugstoreid_chr, comment_vchr, beginretailfigure_int, instorageretailfigure_int, outstorageretailfigure_int, reciperetailfigure_int, putmedretailfigure_int, checkretailfigure_int, adjustretailfigure_int, endretailfigure_int) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)"; clsHRPTableService objHRPServ = new clsHRPTableService(); clsDS_Public_Supported_SVC objPublic = new clsDS_Public_Supported_SVC(); long lngEff = -1; long lngSEQ = 0; lngRes = objPublic.m_lngGetSequence(p_objPrincipal, "SEQ_DS_ACCOUNT", out lngSEQ); if (lngSEQ <= 0) { return(-1); } p_lngSEQ = lngSEQ; System.Data.IDataParameter[] objLisAddItemRefArr = null; objHRPServ.CreateDatabaseParameter(12, out objLisAddItemRefArr); objLisAddItemRefArr[0].Value = lngSEQ; objLisAddItemRefArr[1].Value = p_objRecord.m_strACCOUNTID; objLisAddItemRefArr[2].Value = p_objRecord.m_strDrugStoreid; objLisAddItemRefArr[3].Value = p_objRecord.m_strCOMMENT_VCHR; objLisAddItemRefArr[4].Value = p_objRecord.m_dblBEGINRETAILFIGURE_INT; objLisAddItemRefArr[5].Value = p_objRecord.m_dblINSTORAGERETAILFIGURE_INT; objLisAddItemRefArr[6].Value = p_objRecord.m_dblOUTSTORAGERETAILFIGURE_INT; objLisAddItemRefArr[7].Value = p_objRecord.m_dblRECIPERETAILFIGURE_INT; objLisAddItemRefArr[8].Value = p_objRecord.m_dblPutMedRetailFigure_INT; objLisAddItemRefArr[9].Value = p_objRecord.m_dblCHECKRETAILFIGURE_INT; objLisAddItemRefArr[10].Value = p_objRecord.m_dblADJUSTRETAILFIGURE_INT; objLisAddItemRefArr[11].Value = p_objRecord.m_dblENDRETAILFIGURE_INT; lngRes = objHRPServ.lngExecuteParameterSQL(strSQL, ref lngEff, objLisAddItemRefArr); objHRPServ.Dispose(); objHRPServ = null; } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngAddAccountPeriod(System.Security.Principal.IPrincipal p_objPrincipal, clsDS_AccountPeriodVO p_objAccPeVO, out long p_lngMainSEQ, out string p_strAccoutID) { p_lngMainSEQ = 0; p_strAccoutID = string.Empty; if (p_objAccPeVO == null) { return(-1); } long lngRes = 0; try { string strSQL = @"insert into t_ds_accountperiod t (t.seriesid_int, t.accountid_chr, t.starttime_dat, t.endtime_dat, t.transfertime_dat, t.comment_vchr, t.drugstoreid_chr) values (?, ?, ?, ?, ?, ?, ?)"; clsDS_Public_Supported_SVC objPublic = new clsDS_Public_Supported_SVC(); clsAccount_Supported_SVC objSelect = new clsAccount_Supported_SVC(); IDataParameter[] objLisAddItemRefArr = null; long lngSEQ = 0; lngRes = objPublic.m_lngGetSequence(p_objPrincipal, "SEQ_DS_ACCOUNTPERIOD", out lngSEQ); if (lngSEQ <= 0) { return(-1); } p_lngMainSEQ = lngSEQ; lngRes = objSelect.m_lngGetLatestAccountID(p_objPrincipal, p_objAccPeVO.m_strDrugStoreid, out p_strAccoutID); if (lngRes <= 0 || string.IsNullOrEmpty(p_strAccoutID)) { return(-1); } clsHRPTableService objHRPServ = new clsHRPTableService(); objHRPServ.CreateDatabaseParameter(7, out objLisAddItemRefArr); objLisAddItemRefArr[0].Value = lngSEQ; objLisAddItemRefArr[1].Value = p_strAccoutID; objLisAddItemRefArr[2].DbType = DbType.DateTime; objLisAddItemRefArr[2].Value = p_objAccPeVO.m_dtmSTARTTIME_DAT; objLisAddItemRefArr[3].DbType = DbType.DateTime; objLisAddItemRefArr[3].Value = p_objAccPeVO.m_dtmENDTIME_DAT; objLisAddItemRefArr[4].DbType = DbType.DateTime; objLisAddItemRefArr[4].Value = p_objAccPeVO.m_dtmTRANSFERTIME_DAT; objLisAddItemRefArr[5].Value = p_objAccPeVO.m_strCOMMENT_VCHR; objLisAddItemRefArr[6].Value = p_objAccPeVO.m_strDrugStoreid; long lngRecEff = -1; //往表增加记录 lngRes = objHRPServ.lngExecuteParameterSQL(strSQL, ref lngRecEff, objLisAddItemRefArr); objHRPServ.Dispose(); objHRPServ = null; } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngSaveAmount(System.Security.Principal.IPrincipal p_objPrincipal, clsDS_StorageHistory_VO p_objHistory) { long lngRes = 0; try { string strSQL = @"update t_ds_storage_detail a set a.opavailablegross_num = ?,a.ipavailablegross_num = ? where a.seriesid_int = ?" ; clsHRPTableService objHRPServ = new clsHRPTableService(); IDataParameter[] objDPArr = null; objHRPServ.CreateDatabaseParameter(3, out objDPArr); objDPArr[0].Value = p_objHistory.m_dblNEWOPAVAILABLEGROSS_NUM; objDPArr[1].Value = p_objHistory.m_dblNEWIPAVAILABLEGROSS_NUM; objDPArr[2].Value = p_objHistory.m_lngSERIESID2_INT; long lngEff = -1; lngRes = objHRPServ.lngExecuteParameterSQL(strSQL, ref lngEff, objDPArr); //保存修改可用库存的log if (lngRes > 0) { strSQL = @"insert into t_ds_storagedetail_history a (a.seriesid_int, a.seriesid2_int, a.drugstoreid_chr, a.ipavailablegross_num, a.newipavailablegross_num, a.ipunit_chr, a.opavailablegross_num, a.newopavailablegross_num, a.opunit_chr, a.modifydate_dat, a.modifyuserid_chr,a.medicineid_chr) values (?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate, ?,?)"; clsDS_Public_Supported_SVC objPubSvc = new clsDS_Public_Supported_SVC(); long[] lngSEQArr = null; objPubSvc.m_lngGetSequenceArr(p_objPrincipal, "SEQ_T_DS_STORAGEDETAIL_HISTORY", 1, out lngSEQArr); objDPArr = null; objHRPServ.CreateDatabaseParameter(11, out objDPArr); objDPArr[0].Value = lngSEQArr[0]; objDPArr[1].Value = p_objHistory.m_lngSERIESID2_INT; objDPArr[2].Value = p_objHistory.m_strDRUGSTOREID_CHR; objDPArr[3].Value = p_objHistory.m_dblIPAVAILABLEGROSS_NUM; objDPArr[4].Value = p_objHistory.m_dblNEWIPAVAILABLEGROSS_NUM; objDPArr[5].Value = p_objHistory.m_strIPUNIT_CHR; objDPArr[6].Value = p_objHistory.m_dblOPAVAILABLEGROSS_NUM; objDPArr[7].Value = p_objHistory.m_dblNEWOPAVAILABLEGROSS_NUM; objDPArr[8].Value = p_objHistory.m_strOPUNIT_CHR; objDPArr[9].Value = p_objHistory.m_strMODIFYUSERID_CHR; objDPArr[10].Value = p_objHistory.m_strMEDICINEID_CHR; lngEff = -1; lngRes = objHRPServ.lngExecuteParameterSQL(strSQL, ref lngEff, 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); }