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); }