Example #1
0
        public async Task <ActionResult> MoveElementForCharacter(int projectid, int listItemId, int parentObjectId, int direction)
        {
            try
            {
                await _plotService.MoveElement(projectid, listItemId, parentObjectId, direction);


                return(RedirectToAction("Details", "Character", new { projectId = projectid, characterId = parentObjectId }));
            }
            catch
            {
                return(RedirectToAction("Details", "Character", new { projectId = projectid, characterId = parentObjectId }));
            }
        }
Example #2
0
        private async Task <ActionResult> MoveElementImpl(int projectId, int plotElementId, int parentCharacterId, int direction)
        {
            var field = await ProjectRepository.GetCharacterAsync(projectId, parentCharacterId);

            var error = AsMaster(field, acl => acl.CanEditRoles);

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

            try
            {
                await _plotService.MoveElement(CurrentUserId, projectId, plotElementId, parentCharacterId, direction);


                return(RedirectToAction("Details", "Character", new { projectId, characterId = parentCharacterId }));
            }
            catch
            {
                return(RedirectToAction("Details", "Character", new { projectId, characterId = parentCharacterId }));
            }
        }