Esempio n. 1
0
 public BoardView(Board t, IEnumerable<BList> l)
     : base("BOARD - " + t.Name.ToString(),
         H1(Text("Board: " + t.Name)),
         H2(Text("Description: ")),
         P(Text(t.Description)),
         Ul(
             l.Select(lst => Li(A(ResolveUri.ForList(lst), lst.Name))).ToArray()
             ),
         P(),
         A(ResolveUri.ForBoards(),"Back to Board Manager"),
         H2(Text("Add/Change Description")),
             Form("post", "/boards/" + t.Id,
                 Label("changeDesc", "Description: "),InputText("changeDesc")
                 ),
         H2(Text("Create a new list:")),
             Form("post", "/boards/" + t.Id + "/lists",
                 Label("name", "Name: "), InputText("name")
                 ),
         H2(Form("post", "/boards/" + t.Id + "/delete",
                  InputSubmit("Remove Board")
                 )),
         H2(
             Form("get", 
                  "/boards/" + t.Id.ToString() + "/archive",
                   InputSubmit("Itens Arquivados")
             )
         ))
 {
 }
 public void Remove(Board td)
 {
     _repo.Remove(td.Id);
 }
 public void Add(Board td)
 {
     td.Id = _cid;
     _repo.Add(_cid++,td);
 }
        public HttpResponseMessage CreateBoard(NameValueCollection content)
        {
            var name = content["name"];
            if (name == null)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            foreach (Board td in _repo.GetAll())
            {
                if (td.Name == name)
                    return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }

            var tdAdd = new Board { Name = name };
            _repo.Add(tdAdd);
            //bm.boards.Add(td); // adiciona a board ao contentor de boards no board manager
            var resp = new HttpResponseMessage(HttpStatusCode.SeeOther);
            resp.Headers.Location = new Uri(ResolveUri.ForBoard(tdAdd));
            return resp;
        }
Esempio n. 5
0
 // mostra um board especifico
 public static string ForBoard(Board td)
 {
     return string.Format("http://localhost:8080/boards/{0}", td.Id);
 }
Esempio n. 6
0
 // iv - 2012.10.20
 // novo método
 // permite mostrar a lista arquivada
 public static string ForArchiveList(Board b, BList l)
 {
     return string.Format("http://localhost:8080/boards/{0}/archive/{1}", b.Id, l.IdArchive);
 }
Esempio n. 7
0
 // iv - 2012.10.20
 // novo método
 // permite mostrar todos os itens arquivados de um board (pode mostrar listas e/ ou cards)
 public static string ForArchive(Board b)
 {
     return string.Format("http://localhost:8080/boards/{0}/archive", b.Id);
 }
Esempio n. 8
0
 // iv - 2012.10.18
 // novo método
 // remove um board especifico
 public static string RemoveBoard(Board td)
 {
     return string.Format("http://localhost:8080/boards/{0}/delete", td.Id);
 }