Пример #1
0
 public void Remove(Identity <WorkingTimeRange> identity)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         new WorkingTimeDao(c, t).Delete(identity.Value);
     });
 }
Пример #2
0
 public void RemoveByTaskId(Identity <WorkTask> taskId)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         new WorkingTimeDao(c, t).DeleteByTaskId(taskId.Value);
     });
 }
 public void Delete(Identity <WorkTask> identity)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         new WorkTaskDao(c, t).Delete(identity.Value);
     });
 }
Пример #4
0
 public void UpdateConfiguration(ConfigurationItem item)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         var dao = new ConfigDao(c, t);
         dao.DeleteInsert(ConfigTableRow.FromDomainObject(item));
     });
 }
Пример #5
0
 public void Edit(WorkingTimeRange workingTimeRange)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         var row = WorkingTimeTableRow.FromDomainObject(workingTimeRange);
         var dao = new WorkingTimeDao(c, t);
         dao.Update(row);
     });
 }
 public void Edit(WorkTask task)
 {
     RepositoryAction.Transaction((c, t) =>
     {
         var row = WorkTaskTableRow.FromDomainObject(task);
         var dao = new WorkTaskDao(c, t);
         dao.Update(row);
     });
 }
Пример #7
0
        public void AddRange(WorkingHour[] workingHours)
        {
            RepositoryAction.Transaction((c, t) =>
            {
                var dao = new WorkingHourDao(c, t);

                dao.Delete(workingHours.Select(w => w.Ymd.Value).Distinct().ToArray());

                foreach (var row in workingHours.Where(w => w.IsEmpty == false))
                {
                    dao.Insert(WorkingHourTableRow.FromDomainObjects(row));
                }
            });
        }
Пример #8
0
        public WorkingTimeRange Add(WorkingTimeRange workingTimeRange)
        {
            var row = WorkingTimeTableRow.FromDomainObject(workingTimeRange);

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

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

            return(row.ToDomainObject());
        }
Пример #9
0
        public void Edit(WorkTask task)
        {
            RepositoryAction.Transaction((c, t) =>
            {
                var row     = WorkTaskTableRow.FromDomainObject(task);
                var dao     = new WorkTaskDao(c, t);
                var compDao = new WorkTaskCompletedDao(c, t);
                dao.Update(row);

                if (task.IsCompleted)
                {
                    compDao.InsertIfNotExist(task.Id.Value);
                }
                else
                {
                    compDao.DeleteByWorkTaskId(task.Id.Value);
                }
            });
        }
Пример #10
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());
        }