예제 #1
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        /// Executes this stored procedure with these parameters.
        /// </summary>
        /// <param name="storedProcedureName">The stored procedure to execute.</param>
        /// <param name="parameterValues">The SqlParameters to use.</param>
        /// <returns>List of parameters</returns>
        ///
        public static void ImplementProcedure(String localProcDetails, IDictionary listParam)
        {
            if (localProcDetails == null)
            {
                throw new ArgumentNullException("localProcDetails");
            }
            CleanupParameters(listParam);
            SqlParameter[] inputParamList = null;

            try
            {
                if (!DataLayerRepository.CheckInputParams(listParam))
                {
                    // Get the parameters corresponding to this sproc
                    inputParamList = GetSpParameterSet(localProcDetails);
                    ////Commented by purushotham and recalled the method from utility itself
                    //SqlHelperParameterCache.GetSpParameterSet(tempStrDetails, localProcDetails);
                    // Populate the parameters with the values supplied
                    AssignSqlParameterValues(inputParamList, listParam);
                    // var tempType = "StoredProcedure";
                    //  SqlHelper.ExecuteNonQuery(connectionString, CommandType.StoredProcedure, storedProcedureName, commandParameters);
                    TerraScan.UtilityWrapper.UtilityWrapper.NonQueryResultMethod(localProcDetails, inputParamList);
                }
            }
            catch (Exception)
            {
                throw;
                //HandleException(storedProcedureName, e, commandParameters);
            }
        }
예제 #2
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        /// Fills the DataTable's DataSet with data from the stored procedure.
        /// </summary>
        /// <param name="dataSet">The DataSet to fill.</param>
        /// <param name="storedProcedureName">The stored procedure to execute.</param>
        /// <param name="parameterValues">The values to pass to the stored procedure.</param>
        /// <returns>The SqlParameters from the stored procedure.</returns>
        public static void LoadDataSet(DataSet dataSet, String strProcName, IDictionary listParamItems)
        {
            if (dataSet == null)
            {
                throw new ArgumentNullException("DataSet");
            }
            if (strProcName == null)
            {
                throw new ArgumentNullException("localProcDetails");
            }
            CleanupParameters(listParamItems);
            SqlParameter[] inputParamList = null;

            try
            {
                if (!DataLayerRepository.CheckInputParams(listParamItems))
                {
                    // Get the parameters corresponding to this sproc
                    inputParamList = GetSpParameterSet(strProcName);
                    ////Commented the Calling method and recalled the mehod from same class
                    //SqlHelperParameterCache.GetSpParameterSet(tempStrDetails, strProcName);
                    // Populate the parameters with the values supplied
                    AssignSqlParameterValues(inputParamList, listParamItems);
                    // var tempType = "StoredProcedure"; //CommandType.StoredProcedure.ToString();
                    //// SqlHelper.FillDataset(connectionString, CommandType.StoredProcedure, storedProcedureName, dataSet, null, commandParameters);
                    TerraScan.UtilityWrapper.UtilityWrapper.FillingResultValue(strProcName, dataSet, null, inputParamList);
                }
            }
            catch (Exception)
            {
                throw;
            }
            //return (IList)inputParamList;
        }
예제 #3
0
 /// <summary>
 /// Fetches the sp object.
 /// </summary>
 /// <param name="localStr">The local STR.</param>
 /// <param name="procDetail">The proc detail.</param>
 /// <param name="paramAndValue">The param and value.</param>
 /// <returns></returns>
 public static object FetchSpObject(string procDetail, IDictionary listParamItems)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperSALFetchSpObject(procDetail, listParamItems));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #4
0
 /// <summary>
 /// Excecutes the SP.
 /// </summary>
 /// <param name="localStr">The local STR.</param>
 /// <param name="procDetail">The proc detail.</param>
 /// <param name="listParamItems">The list param items.</param>
 /// <returns></returns>
 public static int LoadProcedureItem(string procDetail, IDictionary listParamItems)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperSALExcecuteSP(procDetail, listParamItems));
         }
         else
         {
             return(0);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #5
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
 /// <summary>
 /// Fetches the SP execute output value.
 /// </summary>
 /// <param name="dataTable">The data table.</param>
 /// <param name="localProcDetails">The local proc details.</param>
 /// <param name="listParamItems">The list param items.</param>
 /// <returns></returns>
 public static IList FetchSPExecuteOutputValue(DataTable dataTable, string localProcDetails, IDictionary listParamItems)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperFetchSPOutputValue(dataTable, localProcDetails, listParamItems));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #6
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
 /// <summary>
 /// Method to execute query and fetch value returned by stored procedure
 /// added output parameter and it will retrun new added record.
 /// </summary>
 /// <param name="storedProcedure">The name of the stored procedure to be executed.</param>
 /// <param name="paramAndValue">The parameters and value for them stored in Dictionary.</param>
 /// <returns>retruns the string</returns>
 public static string FetchSPExecuteXmlString(string localProcDetails, IDictionary listParamItems)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperFetchSPXmlString(localProcDetails, listParamItems));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #7
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
 /// <summary>
 /// Common method to get single output parameter
 /// </summary>
 /// <param name="storedProcedure">Stored Procedure Name</param>
 /// <param name="paramAndValue">Parameter collection with value</param>
 /// <param name="outputParamName">Ouput parameter name</param>
 /// <returns>Output string returned from SP</returns>
 public static string FetchSingleOuputParameter(string localProcDetails, IDictionary listParamItems, string outputParamName)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperFetchSingleOuputParameter(localProcDetails, listParamItems, outputParamName));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #8
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
 public static IList SPParameters(string localProcDetails, DataTable dataTable1, IDictionary listParamItems, DataTable dataTable)
 {
     try
     {
         if (!DataLayerRepository.CheckInputParams(listParamItems))
         {
             return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperSPParameters(localProcDetails, dataTable1, listParamItems, dataTable));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #9
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        /// Method to execute query and fetch value returned by stored procedure
        /// </summary>
        /// <param name="storedProcedure">The name of the stored procedure to be executed.</param>
        /// <param name="paramAndValue">The parameters and value for them stored in Dictionary.</param>
        /// <returns>
        /// The return value(int) from the executed query result.
        /// </returns>


        public static int FetchSPOutput(string localProcDetails, IDictionary listParam)
        {
            try
            {
                if (!DataLayerRepository.CheckInputParams(listParam))
                {
                    return(TerraScan.UtilityWrapper.UtilityWrapper.WrapperFetchSPOutput(localProcDetails, listParam));
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #10
0
파일: Utility.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        /// Fills the DataTable's DataSet with data from the stored procedure.
        /// </summary>
        /// <param name="table">The DataTable to fill.</param>
        /// <param name="storedProcedureName">The stored procedure to execute.</param>
        /// <param name="parameterValues">The values to pass to the stored procedure.</param>
        /// <returns>The SqlParameters from the stored procedure.</returns>
        public static IList LoadDataSet(DataTable table, String localProcDetails, IDictionary listParam)
        {
            if (table == null)
            {
                throw new ArgumentNullException("DataTable");
            }
            if (localProcDetails == null)
            {
                throw new ArgumentNullException("localProcDetails");
            }
            CleanupParameters(listParam);
            SqlParameter[] inputParamList = null;

            try
            {
                if (!DataLayerRepository.CheckInputParams(listParam))
                {
                    // Get the parameters corresponding to this sproc
                    inputParamList = GetSpParameterSet(localProcDetails);
                    //SqlHelperParameterCache.GetSpParameterSet(tempStrDetails, localProcDetails);
                    // Populate the parameters with the values supplied
                    AssignSqlParameterValues(inputParamList, listParam);
                    string[] tableNames = { table.TableName };
                    // var tempType = "StoredProcedure";
                    // SqlHelper.FillDataset(connectionString, CommandType.StoredProcedure, storedProcedureName, table.DataSet, tableNames, commandParameters);
                    TerraScan.UtilityWrapper.UtilityWrapper.FillingResultValue(localProcDetails, table.DataSet, tableNames, inputParamList);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(inputParamList);
        }