コード例 #1
0
ファイル: BaseDB.cs プロジェクト: xiaopohou/BuildDoc
        public DataTable ExecuteDataTableProc(string storedProcedureName, Dictionary <string, object> commandParameters)
        {
            Dictionary <string, string> tmpIpMappingOp;

            //OracleParameter[] sqlParams = Dp2Op(this.GetOwner(), storedProcedureName, commandParameters, out tmpIpMappingOp);
            OracleParameter[] sqlParams = OracleHelperParameterCache.GetSpParameterSet(connectionString, storedProcedureName);
            AssignParameterValues(sqlParams, commandParameters, out tmpIpMappingOp);
            DataTable dt = OracleHelper.ReadTable(connectionString, CommandType.StoredProcedure, storedProcedureName, sqlParams);

            SetOutParamValue(commandParameters, tmpIpMappingOp, sqlParams);
            return(dt);
        }
コード例 #2
0
ファイル: BaseDB.cs プロジェクト: xiaopohou/BuildDoc
        /// <summary>
        /// Executes the non query proc.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="storedProcedureName">Name of the stored procedure.</param>
        /// <param name="commandParameters">The command parameters.</param>
        /// <returns></returns>
        public int ExecuteNonQueryProc(string owner, string storedProcedureName, Dictionary <string, object> commandParameters)
        {
            Dictionary <string, string> tmpIpMappingOp;

            //OracleParameter[] sqlParams = Dp2Op(owner, storedProcedureName, commandParameters, out tmpIpMappingOp);
            OracleParameter[] sqlParams = OracleHelperParameterCache.GetSpParameterSet(connectionString, storedProcedureName);
            AssignParameterValues(sqlParams, commandParameters, out tmpIpMappingOp);
            if (sqlParams != null)
            {
                int result = OracleHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure, owner + "." + storedProcedureName, sqlParams);
                SetOutParamValue(commandParameters, tmpIpMappingOp, sqlParams);
                return(result);
            }
            else
            {
                return(-1);
            }
        }
コード例 #3
0
ファイル: BaseDB.cs プロジェクト: xiaopohou/BuildDoc
        public List <T> ExecuteListProc <T>(string owner, string storedProcedureName, Dictionary <string, object> commandParameters)
        {
            Dictionary <string, string> tmpIpMappingOp;

            //OracleParameter[] sqlParams = Dp2Op(owner, storedProcedureName, commandParameters, out tmpIpMappingOp);
            OracleParameter[] sqlParams = OracleHelperParameterCache.GetSpParameterSet(connectionString, storedProcedureName);
            AssignParameterValues(sqlParams, commandParameters, out tmpIpMappingOp);
            if (sqlParams != null)
            {
                OracleDataReader odr = OracleHelper.ExecuteReader(connectionString, CommandType.StoredProcedure, storedProcedureName, sqlParams);
                SetOutParamValue(commandParameters, tmpIpMappingOp, sqlParams);
                var result = Mapper.DynamicMap <IDataReader, List <T> >(odr);
                odr.Close();

                return(result);
            }
            else
            {
                return(null);
            }
        }