//
 // GET: /Card/Edit/5
 public ActionResult Edit(string board, string list, string id)
 {
     currUser = User.Identity.Name;
     int bid = int.Parse(board);
     int lid = int.Parse(list);
     int cid = int.Parse(id);
     Card c = _repo.GetCard(bid, lid, cid);
     if (c == null) return new HttpNotFoundResult("O Cartão não existe");
     CardDetailsDTO cardDto = new CardDetailsDTO();
     cardDto.Board = board;
     cardDto.List = list;
     cardDto.SingleCard = new Pair(currUser, c);
     cardDto.IsOwned = _userRepo.IsUserBoard(bid, currUser);
     cardDto.IsVisual = _userRepo.BoardOnlyVis(bid, currUser);
     ViewData["UserCardNames"] = _repo.GetAllCardNames(bid, lid);
     ViewData["board"] = board;
     return View(cardDto);
 }
        public CardDetailsDTO InitializeCardDetailsDTO(string board, string list, string id, string currUser)
        {
            IUserRepository _userRepo= RepoLocator.GetUsers();
            int bid = int.Parse(board);
            int lid = int.Parse(list);
            int cid = int.Parse(id);

            CardDetailsDTO dto = new CardDetailsDTO();

            if (_userRepo.BoardOnlyVis(bid, currUser))
            {
                dto.IsOwned = false;
                dto.IsVisual = true;
                dto.SingleCard = new Pair(_userRepo.GetVis(bid, currUser).First, GetCard(bid, lid, cid));
            }
            else if (_userRepo.BoardOnlyEdit(bid, currUser))
            {
                dto.IsOwned = false;
                dto.IsVisual = false;
                dto.SingleCard = new Pair(_userRepo.GetEdit(bid, currUser).First, GetCard(bid, lid, cid));
            }
            else
            {
                dto.IsOwned = true;
                dto.IsVisual = false;
                dto.SingleCard = new Pair(currUser, GetCard(bid, lid, cid));
            }
            return dto;
        }