public IActionResult AddLector(int subjectId, [FromQuery] int semesterId) { var model = new SubjectAddLectorInputModel { SemesterId = semesterId, SubjectId = subjectId, }; return(this.View(model)); }
public async Task <IActionResult> AddLector(int subjectId, [FromQuery] int semesterId, SubjectAddLectorInputModel input) { if (!this.ModelState.IsValid) { return(this.View(input)); } var hasCreated = await this.semestersService.AddLectorAsync(subjectId, semesterId, input.Email); if (hasCreated == false) { this.TempData["message"] = "The test has already closed!"; return(this.View(input)); } return(this.RedirectToAction("Details", "Semesters", new { semesterId })); }