public ActionResult <Card> Get(int id)
 {
     try
     {
         return(Ok(_cs.GetById(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemple #2
0
        public CardEditForm(Topic topic, string category, string deck, Guid id)
        {
            InitializeComponent();

            _topic        = topic;
            _category     = category;
            _deck         = deck;
            _cardsService = new CardsService();

            _card = _cardsService.GetById(_topic, _category, _deck, id);

            SetControlsValues(_card);
            ToggleEditMode(false);
            btnSave.Visible = false;
        }
Exemple #3
0
 private void btnPrevious_Click(object sender, EventArgs e)
 {
     _card = _cardsService.GetById(_topic, _category, _deck, _card.PreviousCardId);
     SetControlsValues(_card);
     ToggleEditMode(false);
 }