Ejemplo n.º 1
0
        public static int RunSP(string spName, Paras paras)
        {
            switch (DBAccess.AppCenterDBType)
            {
            case DBType.MSSQL:
                SqlConnection conn = new SqlConnection(SystemConfig.AppCenterDSN);
                if (conn.State != ConnectionState.Open)
                {
                    conn.Open();
                }
                return(DBProcedure.RunSP(spName, paras, conn));

                break;

            case DBType.Informix:
                IfxConnection conn1 = new IfxConnection(SystemConfig.AppCenterDSN);
                if (conn1.State != ConnectionState.Open)
                {
                    conn1.Open();
                }
                return(DBProcedure.RunSP(spName, paras, conn1));

                break;

            default:
                throw new Exception("尚未处理。");
                break;
            }
        }
Ejemplo n.º 2
0
        public static int RunSP(string spName, string para, string paraVal)
        {
            Paras paras = new Paras();
            Para  p     = new Para(para, DbType.String, paraVal);

            paras.Add(p);
            return(DBProcedure.RunSP(spName, paras, DBAccessOfOracle1.GetSingleConn));
        }
Ejemplo n.º 3
0
        public static int RunSPReturnInt(string spName, OracleConnection conn)
        {
            object obj = DBProcedure.RunSPReturnObj(spName, conn);

            if (obj == null || obj == DBNull.Value)
            {
                throw new Exception("@SpName 错误:" + spName + ",返回 null 值。");
            }
            return(int.Parse(obj.ToString()));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 运行存储过程返回Table
 /// </summary>
 /// <param name="spName">存储过程名称</param>
 /// <param name="paras">参说集合</param>
 /// <returns>执行后的Table</returns>
 public static DataTable RunSPReturnDataTable(string spName, Paras paras)
 {
     if (DBAccess.AppCenterDBType == DBType.MSSQL)
     {
         return(DBProcedure.RunSPReturnDataTable(spName, paras, (SqlConnection)DBAccess.GetAppCenterDBConn));
     }
     else
     {
         return(DBProcedure.RunSPReturnDataTable(spName, paras, (SqlConnection)DBAccess.GetAppCenterDBConn));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 运行存储过程
 /// </summary>
 /// <param name="spName">名称</param>
 /// <param name="paras">参数</param>
 /// <returns>DataTable</returns>
 public static DataTable RunSPReTable(string spName, Paras paras)
 {
     return(DBProcedure.RunSPReturnDataTable(spName, paras, DBAccessOfMSSQL2.GetSingleConn));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 运行存储过程
 /// </summary>
 /// <param name="spName">名称</param>
 /// <param name="paras">参数</param>
 /// <returns>返回影响的行数</returns>
 public static int RunSP(string spName, Paras paras)
 {
     return(DBProcedure.RunSP(spName, paras, DBAccessOfMSSQL2.GetSingleConn));
 }
Ejemplo n.º 7
0
        public static DataTable RunSPReturnDataTable(string spName, OracleConnection conn)
        {
            Paras ens = new Paras();

            return(DBProcedure.RunSPReturnDataTable(spName, ens, conn));
        }
Ejemplo n.º 8
0
 public static decimal RunSPReturnDecimal(string spName, OracleConnection conn)
 {
     return(decimal.Parse(DBProcedure.RunSPReturnDecimal(spName, conn).ToString()));
 }
Ejemplo n.º 9
0
 public static float RunSPReturnFloat(string spName, OracleConnection conn)
 {
     return(float.Parse(DBProcedure.RunSPReturnFloat(spName, conn).ToString()));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 运行存储过程
 /// </summary>
 /// <param name="spName">名称</param>
 /// <returns>DataTable</returns>
 public static DataTable RunSPReTable(string spName)
 {
     return(DBProcedure.RunSPReturnDataTable(spName, DBAccessOfOracle1.GetSingleConn));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 运行存储过程
 /// </summary>
 /// <param name="spName">名称</param>
 /// <returns>返回影响的行数</returns>
 public static int RunSP(string spName)
 {
     return(DBProcedure.RunSP(spName, DBAccessOfOracle1.GetSingleConn));
 }