コード例 #1
0
 public bool AddCard(int bid, int lid, Card card)
 {
     card.BeginDate = DateTime.Now.ToString("dd'/'MM'/'yyyy");
     card.Id = ++cCount;
     cardRepo[bid][lid].AddLast(card);
     return true;
 }
コード例 #2
0
 public ActionResult Create(string board, string list, Card card)
 {
     if (_repo.AddCard(int.Parse(board), int.Parse(list), card))
         return RedirectToAction("Details", "Board", new { id = board });
     return new HttpNotFoundResult("Erro");
 }
コード例 #3
0
        public ActionResult Edit(int board, int list, Card c, bool isAjaxRequest)
        {
            _repo.SubCard(board, list, c);
            ViewData["board"] = board;
            //return View("Board", "Details", board);
            if (!isAjaxRequest)
                return RedirectToAction("Edit", "Card", new { board = board, list = list, id = c.Id });

            return PartialView("CardDetailsPartial", _repo.GetCard(board, list, c.Id));
        }
コード例 #4
0
 public bool SubCard(int bid, int lid, Card c)
 {
     foreach(Card ca in cardRepo[bid][lid])
         if (ca.Id == c.Id) {
             ca.BeginDate = c.BeginDate;
             ca.Description = c.Description;
             ca.EndDate = c.EndDate;
             ca.Name = c.Name;
             return true;
         }
     return false;
 }