Beispiel #1
0
        public IList <FindUserNodesResult> FindUserNodes(FindUserNodesParameters parameters)
        {
            using (TransactionScope scope = new TransactionScope())
            {
                IList <FindUserNodesResult> result = null;

                using (IDbConnection connection = new DbConnection(ConnectionString))
                {
                    connection.Open();

                    using (IDbCommand command = connection.CreateCommand())
                    {
                        command.CommandText = StatementCache.Instance.GetCachedStatement("Imi.SupplyChain.Transportation.Authentication.DataAccess.Queries.FindUserNodes.sql");
                        ((OracleCommand)command).BindByName = true;

                        foreach (IDbDataParameter parameter in FindUserNodesTranslator.TranslateParameters(parameters))
                        {
                            command.Parameters.Add(parameter);
                        }

                        command.Prepare();

                        using (IDataReader reader = command.ExecuteReader())
                        {
                            result = FindUserNodesTranslator.TranslateResultSet(reader);
                        }
                    }
                }

                scope.Complete();

                return(result);
            }
        }
Beispiel #2
0
        public IList <FindUserNodesResult> FindAllNodes()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                IList <FindUserNodesResult> result = null;

                using (IDbConnection connection = new DbConnection(ConnectionString))
                {
                    connection.Open();

                    using (IDbCommand command = connection.CreateCommand())
                    {
                        command.CommandText = StatementCache.Instance.GetCachedStatement("Imi.SupplyChain.Transportation.Authentication.DataAccess.Queries.FindAllNodes.sql");
                        command.Prepare();

                        using (IDataReader reader = command.ExecuteReader())
                        {
                            result = FindUserNodesTranslator.TranslateResultSet(reader);
                        }
                    }
                }

                scope.Complete();

                return(result);
            }
        }