public async Task <ActionResult> EditSubjectPerformance(StudentPerformanceDto studentPerformance)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View("Edit", studentPerformance));
                }
                await _performanceService.EditPerformanceAsync(studentPerformance);

                return(RedirectToAction("Details", "Subject", new { id = studentPerformance.SubjectId }));
            }
            catch (SPCException ex)
            {
                return(View("ErrorView", new ErrorDto(ex.Message, ex.StatusCode)));
            }
            catch (Exception ex)
            {
                return(View("Error"));
            }
        }
Exemple #2
0
 public async Task <IActionResult> EditSubjectPerformance([FromBody] StudentPerformanceDto studentPerformance)
 {
     return(await HandleRequestAsync(async() =>
                                     await _performanceService.EditPerformanceAsync(studentPerformance)));
 }