/// <summary> /// При загрузке формы. /// </summary> private void Form_Load(object sender, EventArgs e) { try { var isEdit = _publicationId > 0; if (isEdit) { var entity = _publicationService.GetPublicationById(_publicationId); tbName.Text = entity.Name; tbCoauthors.Text = entity.Coauthors; numVolume.Value = entity.Volume ?? 0; cbIsPublished.Checked = entity.IsPublished; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IActionResult GetPublicationById(int publication_id) { var publication = _publicationService.GetPublicationById(publication_id); return(Ok(publication)); }