Пример #1
0
        public static DA.Task ToEntity(this DT.Task source)
        {
            if (source == null)
            {
                return(null);
            }
            var result = new DA.Task();

            source.CopyToEntity(result);
            return(result);
        }
Пример #2
0
        public void UpdateTask(DT.Task taskDto)
        {
            RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave);
            AuthorizationManager.AuthorizeForTask(taskDto.Id, Permission.Full);
            var pm = PersistenceManager;

            using (new PerformanceLogger("UpdateTask")) {
                var taskDao = pm.TaskDao;
                pm.UseTransaction(() => {
                    var task = taskDao.GetById(taskDto.Id);
                    taskDto.CopyToEntity(task);
                    pm.SubmitChanges();
                });
            }
        }