Beispiel #1
0
        public ImportedTask[] SelectByImportKeys(string[] importKeys)
        {
            ImportedTask[] results = null;

            RepositoryAction.Query(c =>
            {
                var dao = new ImportedTaskDao(c, null);

                results = dao.SelectByImportKeys(importKeys).Select(d => d.ConvertToDomainObject()).ToArray();
            });

            return(results);
        }
Beispiel #2
0
        private WorkTask AddCore(WorkTask task, ImportedTask workTaskImportSource)
        {
            var row = WorkTaskTableRow.FromDomainObject(task);

            RepositoryAction.Transaction((c, t) =>
            {
                var dao = new WorkTaskDao(c, t);
                var id  = dao.Insert(row);

                // ID採番結果
                row.Id = id;

                // スケジュールからの取込の場合は取込歴にも残す
                if (task.IsScheduled)
                {
                    var importDao = new ImportedTaskDao(c, t);
                    importDao.Insert(ImportedTaskTableRow.FromDomainObject(id, workTaskImportSource));
                }
            });

            return(WorkTaskFactory.Create(row, task.IsCompleted));
        }
        public WorkTask Add(WorkTask task)
        {
            var row = WorkTaskTableRow.FromDomainObject(task);

            RepositoryAction.Transaction((c, t) =>
            {
                var dao = new WorkTaskDao(c, t);
                var id  = dao.Insert(row);

                // ID採番結果
                row.Id = id;

                // スケジュールからの取込の場合は取込歴にも残す
                if (task.IsScheduled)
                {
                    var importDao = new ImportedTaskDao(c, t);
                    importDao.Insert(ImportedTaskTableRow.FromDomainObject(task));
                }
            });

            return(row.ConvertToDomainObject());
        }