Ejemplo n.º 1
0
        private static BuilderStore GetParameterObjectOracle(DataTable dt)
        {
            BuilderStore store = new BuilderStore();

            store.StoreProcedureName = dt.TableName;

            List <BuilderParameter> parameter = new List <BuilderParameter>();

            foreach (DataRow row in dt.Rows)
            {
                BuilderParameter param = new BuilderParameter();
                param.ParamName = row["ARGUMENT_NAME"].ToString();
                param.TypeName  = ConvertType(row["DATA_TYPE"].ToString());
                param.isoutput  = row["IN_OUT"].ToString().ToUpper() == "IN" ? 1 : 0;
                parameter.Add(param);
            }
            store.AddParameterList(parameter);
            return(store);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据DataTable生成模板使用的对象
        /// </summary>
        /// <param name="dt">存储过程的数据集合</param>
        /// <returns>模板使用的对象</returns>
        public static BuilderStore GetParameterObject(DataTable dt)
        {
            BuilderStore store = new BuilderStore();

            store.StoreProcedureName = dt.TableName;

            List <BuilderParameter> parameter = new List <BuilderParameter>();

            foreach (DataRow row in dt.Rows)
            {
                BuilderParameter param = new BuilderParameter();
                param.ParamName = row["ParamName"].ToString().Replace("@", string.Empty);
                param.TypeName  = ConvertType(row["TypeName"].ToString());
                param.ParamLeng = int.Parse(row["ParamLength"].ToString());
                param.isoutput  = row["is_output"].ToString().ToUpper() == "TRUE" ? 1 : 0;
                parameter.Add(param);
            }
            store.AddParameterList(parameter);
            return(store);
        }