public void Add(Card c, int idList, int idBoard)
 {
     c.IdBoard = idBoard;
     c.IdList = idList;
     c.Id = _cid;
     _repo.Add(_cid++, c);
 }
Exemple #2
0
 public CardArchive(Card c)
     : base("Card Archive - " + c.IdArchive.ToString(),
         H1(Text("Card: " + c.Name)),
         H2(Text("Description: ")),
         P(Text(c.Description)),
         P(Text("Creation date: " + c.CreationDate)),
         P(Text("Conclusion Date: " + c.ConclusionLimitDate)),
         P(),
         A("http://localhost:8080/boards/" + c.IdBoard, "Back to Board Viewer"),
         P(),
         A(ResolveUri.ForBoards(), "Back to Boards Manager"))
 {
 }
Exemple #3
0
 public CardView(Card c)
     : base("CARD - " + c.Id.ToString() + " da lista - " + c.IdList.ToString() + " do board - " + c.IdBoard.ToString(),
         H1(Text("Card: " + c.Name)),
         H2(Text("Description: ")),
         P(Text(c.Description)),
         P(Text("Creation date: " + c.CreationDate)),
         P(Text("Conclusion Date: " + c.ConclusionLimitDate)),
         P(),
         A("http://localhost:8080/boards/" + c.IdBoard + "/lists/"+ c.IdList, "Back to List Viewer"),
         P(),
         A("http://localhost:8080/boards/" + c.IdBoard, "Back to Board Viewer"),
         P(),
         A(ResolveUri.ForBoards(), "Back to Boards Manager"),
         H2(Text("Add/Change Description")),
             Form("post", "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" +c.Id,
                 Label("changeDesc", "Description: "),InputText("changeDesc")
                 ),
         H2(Form("post", 
                  "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id +"/setlimit",
                  Label("cDate", "Conclusion Date Limit (dd-mm-aaaa hh:mm:ss): "),InputText ("cDate")
             )),
         H2(Form("post", "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id +"/delete",
                      InputSubmit("Remove Card")
                     )),
         H2(
             Form("post", 
                  "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id +"/archive",
                   InputSubmit("Arquivar"))),
         H2(
             Form("post", "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id + "/up",
                     InputSubmit("Move Up")
                     )),
         H2(
             Form("post", "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id + "/down",
                     InputSubmit("Mode Down")
                     )),
         H2(Form("post",
             "/boards/" + c.IdBoard + "/lists/" + c.IdList + "/cards/" + c.Id + "/changeList",
             Label("cDate", "Write the name of destination List: "), InputText("dListName")
             )))
 {
 }
 public void Remove(Card c)
 {
     _repo.Remove(c.IdArchive);
 }
 public void Add(Card c)
 {
     c.IdArchive = _cid;
     _repo.Add(_cid++, c);
 }
 // iv - 2012.11.11
 public void Add(string name, int idList, int idBoard)
 {
     Card c = new Card { Id = _cid, IdBoard = idBoard, IdList = idList, Name = name };
     _repo.Add(_cid++, c);
 }
 //iv - 2012.11.11
 /*public void Remove(int id)
 {
     if (_repo.Count > 0)
     {
         foreach (var card in _repo)
         {
             if (card.Value.Id == id)
             {
                 _repo.Remove(card.Key);
                 break;
             }
         }
     }
 }*/
 // 2012.10.19 - João
 //remove a lista de um board
 public void Remove(Card c)
 {
     _repo.Remove(c.Id);
 }
        public HttpResponseMessage CreateCard(NameValueCollection content, int id, int id2)
        {
            Board td = _repo.GetById(id);
            BList lst = _repoList.GetById(id2);
            var name = content["name"];

            if (td == null || lst == null){
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }

            if (name == null)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }

            var c = new Card { Name = name };
            c.CreationDate = DateTime.Now;
            _repoCard.Add(c, id2, id);
            //lst.cards.Add(c);  // adiciona a lista ao contentor de listas da board
            var resp = new HttpResponseMessage(HttpStatusCode.SeeOther);

            resp.Headers.Location = new Uri(ResolveUri.ForCard(c));
            return resp;
        }
Exemple #9
0
 // dm - 2012.10.21
 //novo metodo
 //permite mover a card uma posição para cima
 public static string MoveCardUp(Card c)
 {
     return string.Format("http://localhost:8080/boards/{0}/lists/{1}/cards/{2}/up", c.IdBoard, c.IdList, c.Id);
 }
Exemple #10
0
 // iv - 2012.10.20
 // novo método
 // permite mostrar o cartão arquivado
 public static string ForArchiveCard(int IdBoard, Card c)
 {
     return string.Format("http://localhost:8080/boards/{0}/archive/{1}", IdBoard, c.IdArchive);
 }
Exemple #11
0
 // dm - 2012.10.22
 //novo metodo
 //permite mover a card para a lista indicada
 public static string ChangeList(Card c)
 {
     return string.Format("http://localhost:8080/boards/{0}/lists/{1}/cards/{2}/changeList", c.IdBoard, c.IdList, c.Id);
 }
Exemple #12
0
 // iv - 2012.10.20
 // novo método
 // permite arquivar o cartão
 public static string ArchiveCard(Card c)
 {
     return string.Format("http://localhost:8080/boards/{0}/lists/{1}/cards/{2}/archive", c.IdBoard, c.IdList, c.Id);
 }