Example #1
0
        /// <summary>
        /// 指定した前処理履歴の出力結果として、データを一件追加する。
        /// </summary>
        public void AddOutputData(long historyId, Data newData)
        {
            PreprocessHistoryOutput image = new PreprocessHistoryOutput()
            {
                PreprocessHistoryId = historyId,
                OutputData          = newData
            };

            AddModel <PreprocessHistoryOutput>(image);
        }
Example #2
0
        /// <summary>
        /// 指定した前処理履歴の結果の中で、編集不能になっている結果を一件返す。
        /// この結果がnullでない場合は、この前処理履歴結果は削除できない
        /// </summary>
        public PreprocessHistoryOutput GetLockedOutput(long id)
        {
            //判定1: ロックされたデータセットに含まれているか
            PreprocessHistoryOutput lockedOutput = FindModelAll <PreprocessHistoryOutput>(o => o.PreprocessHistoryId == id).Where(o =>
                                                                                                                                  GetDbSet <DataSetEntry>().Include(e => e.DataSet) //出力結果を含み、編集不可なデータセットが1件以上あるか
                                                                                                                                  .Where(e => e.DataSet.IsLocked)
                                                                                                                                  .Where(e => e.DataId == o.OutputDataId).Count() > 0
                                                                                                                                  ).FirstOrDefault();

            if (lockedOutput != null)
            {
                return(lockedOutput);
            }

            //判定2: 前処理出力が更に前処理されているか
            lockedOutput = FindModelAll <PreprocessHistoryOutput>(o => o.PreprocessHistoryId == id).Where(o =>
                                                                                                          GetDbSet <PreprocessHistory>().Where(history => history.InputDataId == o.OutputDataId).Count() > 0
                                                                                                          ).FirstOrDefault();

            return(lockedOutput);
        }