Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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"));
            }
        }