.NET易忘备留 ORACLE存储过程调用

1.Oracle存储过程调用【返回信息,单体或者列表】

        public IResult FundBuild(string partnerId,string userId, DateTime beginDate, DateTime endDate)
        {
            List<DbParameter> dbList = new List<DbParameter>();
            dbList.Add(new DbParameter { Name = "v_parnter_id", Value = partnerId });
            dbList.Add(new DbParameter { Name = "v_start_date", Value = beginDate });
            dbList.Add(new DbParameter { Name = "v_end_date", Value = endDate });
            dbList.Add(new DbParameter { Name = "v_operator", Value = userId });
            dbList.Add(new DbParameter { Name = "v_error_code", Direction = ParameterDirection.Output });
            dbList.Add(new DbParameter { Name = "v_msg", Direction = ParameterDirection.Output });
            ArrayList rev = dbAccess.DbProvider.ExcuteProcToArray("sp_dchannel_fund_build", dbList.ToArray());
            bool status = CommFun.ToInt(rev[0], -1) == ErrorCode.Success;
            string msg = rev[1] as string;
            return new Result(status, msg);
        }

        public DataTable GetShopReport(ShopOrderQuery query)
        {

            List<OracleParameter> pList = new List<OracleParameter>();
            pList.Add(new OracleParameter { ParameterName = "v_platform_id", Value = query.PlatFormId });
            pList.Add(new OracleParameter { ParameterName = "v_business_type", Value = query.BusinessType });
            pList.Add(new OracleParameter { ParameterName = "v_product_no", Value = query.ProductNo });
            pList.Add(new OracleParameter { ParameterName = "v_shop_id", Value = query.ShopId });
            pList.Add(new OracleParameter { ParameterName = "v_business_no", Value = query.BusinessNo });
            pList.Add(new OracleParameter { ParameterName = "v_begin_date", Value = query.BeginDate });
            pList.Add(new OracleParameter { ParameterName = "v_end_date", Value = query.EndDate });
            OracleParameter dataset = new OracleParameter { ParameterName = "v_data", OracleDbType = OracleDbType.RefCursor, Direction = ParameterDirection.Output };
            pList.Add(dataset);
            DataSet ds = _platformOrderDataAccess.DbProvider.GetDataSetByProcedure("bp_sp_sale_report", pList.ToArray());
            return ds.Tables[0];
        }

posted @ 2013-12-03 10:29  流失的痕迹  阅读(352)  评论(0编辑  收藏  举报