コード例 #1
0
 public ActionResult Edit(int board, List l, bool isAjaxRequest)
 {
     if (_repo.SubList(board, l))
     {
         currUser = User.Identity.Name;
         int lid = l.Id;
         ListDetailsDTO listDto = new ListDetailsDTO();
         listDto.SingleList = new Pair(currUser, l);
         listDto.IsOwned = _userRepo.IsUserBoard(board, currUser);
         listDto.IsVisual = _userRepo.BoardOnlyVis(board, currUser);
         listDto.BoardId = board;
         if (!isAjaxRequest)
             return View(listDto);
         return PartialView("ListDetailsPartial", listDto);
     }
     return View(_repo.GetList(board, l.Id));
 }
コード例 #2
0
        //
        // GET: /List/Edit/5
        public ActionResult Edit(int board, int list)
        {
            currUser = User.Identity.Name;

            List l=_repo.GetList(board, list);
            if ( l == null) return new HttpNotFoundResult("A Lista não existe");
            if (!_userRepo.HasBoard(board, currUser)) return new HttpUnauthorizedResult("Não tem acesso a esta lista");
            ListDetailsDTO listDto = new ListDetailsDTO();
            listDto.SingleList = new Pair(currUser, l);
            listDto.IsOwned = _userRepo.IsUserBoard(board, currUser);
            listDto.IsVisual= _userRepo.BoardOnlyVis(board,currUser);
            listDto.BoardId = board;
            ViewData["userListName"] = _repo.GetAllListsNameExceptArchive(board);
            return View(listDto);
        }
コード例 #3
0
        public ListDetailsDTO InitializeListDetailsDTO(int bid, int lid, string currUser)
        {
            IUserRepository _userRepo = RepoLocator.GetUsers();
            ListDetailsDTO dto = new ListDetailsDTO();
            if (_userRepo.BoardOnlyVis(bid, currUser))
            {
                dto.IsOwned = false;
                dto.IsVisual = true;
                dto.SingleList = new Pair(_userRepo.GetVis(bid, currUser).First, GetList(bid, lid));

            }
            else if (_userRepo.BoardOnlyEdit(bid, currUser))
            {
                dto.IsOwned = false;
                dto.IsVisual = false;
                dto.SingleList = new Pair(_userRepo.GetEdit(bid, currUser).First, GetList(bid, lid));

            }
            else
            {
                dto.IsOwned = true;
                dto.IsVisual = false;
                dto.SingleList = new Pair(currUser, GetList(bid, lid));
            }
            dto.ListCards = ShowListsAndCards(bid)[lid];

            return dto;
        }