Exemplo n.º 1
0
        public WorkTask SelectById(Identity <WorkTask> identity)
        {
            WorkTask results = null;

            RepositoryAction.Query(c =>
            {
                var dao     = new WorkTaskDao(c, null);
                var compDao = new WorkTaskCompletedDao(c, null);
                var exist   = compDao.IsCompleted(identity.Value);

                results = WorkTaskFactory.Create(dao.SelectById(identity.Value), exist);
            });

            return(results);
        }
Exemplo n.º 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));
        }