public ActionResult <Card> Get(int id) { try { return(Ok(_cs.GetById(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
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; }
private void btnPrevious_Click(object sender, EventArgs e) { _card = _cardsService.GetById(_topic, _category, _deck, _card.PreviousCardId); SetControlsValues(_card); ToggleEditMode(false); }