private void DodajOceneBtn_Click(object sender, RoutedEventArgs e) { var row = (StudentsTable)ListaStudentowDg.SelectedItem; AddAssessment DodawanieOceny = new AddAssessment(row.Id); bool? result = DodawanieOceny.ShowDialog(); if (result == true) { ListaStudentowDg_SelectionChanged(null, null); } }
public async Task <ActionResult> AddAssessment([FromBody] AddAssessment model) { string userId = "anyId"; if (Request.Cookies.ContainsKey("id")) { userId = Request.Cookies["id"]; } try { using var service = _bookService; await service.AddAssessment(model.BookId, userId, model.Assessment); return(Ok()); } catch (Exception) { return(BadRequest("Error")); } }