Example #1
0
 public async Task <int[]> ResolveAllProcessIds()
 {
     return(ProcessIds.Concat(
                await TryFoundMatchedProcesses()
                ).ToArray());
 }
        public DataSet SearchLessonsLearned()
        {
            ICustomDataAdapter da      = DataAccess.GetCustomDataAdapter();
            DataSet            results = new DataSet(); //make sure we use a loosely typed dataset as there will be more columns returned than just from the hedge table

            IDbCommand cmd;

            cmd             = DBConnection.CreateCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "LL_LEARNED_PKG.SEARCH_RECORD";

            CreateParameter(ref cmd, "userId", ParameterDirection.Input, DbType.String, "USER_ID");
            CreateParameter(ref cmd, "pkeywords", ParameterDirection.Input, DbType.String, "KEY_WORDS");
            CreateParameter(ref cmd, "psbuids", ParameterDirection.Input, DbType.String, "SBU_IDS");
            CreateParameter(ref cmd, "pbuids", ParameterDirection.Input, DbType.String, "BU_IDS");
            CreateParameter(ref cmd, "pprojectids", ParameterDirection.Input, DbType.String, "PROJECT_IDS");
            CreateParameter(ref cmd, "pprocessids", ParameterDirection.Input, DbType.String, "PROCESS_IDS");
            CreateParameter(ref cmd, "pdisciplineids", ParameterDirection.Input, DbType.String, "DISCIPLINE_IDS");
            CreateParameter(ref cmd, "pstageids", ParameterDirection.Input, DbType.String, "STAGE_IDS");
            CreateParameter(ref cmd, "pcategoryids", ParameterDirection.Input, DbType.String, "CATEGORY_IDS");

            ((IDbDataParameter)cmd.Parameters["userId"]).Value         = CurrentUser;
            ((IDbDataParameter)cmd.Parameters["pkeywords"]).Value      = KeyWords.ToString();
            ((IDbDataParameter)cmd.Parameters["psbuids"]).Value        = SBUIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pbuids"]).Value         = BUIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pprojectids"]).Value    = ProjectIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pprocessids"]).Value    = ProcessIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pdisciplineids"]).Value = DisciplineIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pstageids"]).Value      = StageIds.ToString();
            ((IDbDataParameter)cmd.Parameters["pcategoryids"]).Value   = CategoryIds.ToString();

            try
            {
                da.SelectCommand = cmd;
                da.Fill(results);
            }
            catch (Exception ex)
            {
                //If we get an error opening the result for the stored
                //procedure, we likely have a a farily major problem.
                //Permissions issues or something of the kind.  We will
                //percolate the call back up the stack so the front end
                //may report it and thus the user can log the error
                //for repair.
                throw ex;
            }
            finally
            {
                if (cmd != null)
                {
                    cmd.Connection.Close();
                    cmd.Connection.Dispose();
                    cmd.Dispose();
                    cmd = null;
                }

                if (da != null)
                {
                    da.Dispose();
                    da = null;
                }
            }

            return(results);
        }