public ActionResult SaveCard(Card newCard) { newCard.CardHolderID = cardHolderID; Card.CreateCard(newCard, boardID); return RedirectToAction("PresentBoard", "Board", new { id = boardID }); }
public ActionResult UpdateCard(Card card, int id) { card.CardID = id; card.CardHolderID = cardHolderID; if (!Card.UpdateCard(card)) return View("Error"); return RedirectToAction("PresentBoard", "Board", new { id = boardID }); }
public ActionResult NewCard(int id) { CardHolder cardHolder = CardHolder.getCardHolderByID(id); if (cardHolder == null) return View("Error"); boardID = cardHolder.BoardID; cardHolderID = id; Card card = new Card(); return View("CreateCard", card); }
public static bool CreateCard(Card item, int boardID) { DAL.DataObjects.Card newCard = copyToDataObject(item); return BoardsManager.CreateCard(boardID, item.CardHolderID, newCard); }
public static Card copyFromDataObject(DAL.DataObjects.Card dataObjCard) { Card newCard = new Card(); newCard.cardID = dataObjCard.CardId; newCard.cardHolderID = dataObjCard.CardHolderId; newCard.name = dataObjCard.Name; newCard.description = dataObjCard.Description; newCard.creationDate = dataObjCard.CreationDate; newCard.finalDate = dataObjCard.FinalDate; return newCard; }
public static DAL.DataObjects.Card copyToDataObject(Card domainLayerCard) { DAL.DataObjects.Card newCard = new DAL.DataObjects.Card(); newCard.CardId = domainLayerCard.CardID; newCard.CardHolderId = domainLayerCard.CardHolderID; newCard.Name = domainLayerCard.Name; newCard.Description = domainLayerCard.Description; newCard.CreationDate = domainLayerCard.CreationDate; newCard.FinalDate = domainLayerCard.FinalDate; return newCard; }
public static bool UpdateCard(Card card) { DAL.DataObjects.Card item = copyToDataObject(card); return BoardsManager.UpdateCard(item); }