diff --git a/SchoolAgainStudy/StudentWebClient/Controllers/HomeController.cs b/SchoolAgainStudy/StudentWebClient/Controllers/HomeController.cs index 554e8d1..ebac057 100644 --- a/SchoolAgainStudy/StudentWebClient/Controllers/HomeController.cs +++ b/SchoolAgainStudy/StudentWebClient/Controllers/HomeController.cs @@ -205,7 +205,7 @@ namespace StudentWebClient.Controllers { return Redirect("~/Home/Enter"); } - return View(_diy.ReadList(new DiySearchModel { Id = APIClient.Student.Id})); + return View(_diy.ReadList(new DiySearchModel { StudentId = APIClient.Student.Id})); } [HttpGet] public IActionResult CreateDiy() @@ -250,7 +250,7 @@ namespace StudentWebClient.Controllers public IActionResult DiySetting(int id) { var diy = _diy.ReadElement(new DiySearchModel { Id = id }); - var interests = _interest.ReadList(null).Select(x => new {InterestId = x.Id, InterestName = x.Title}).ToList(); + var interests = _interest.ReadList(new InterestSearchModel { StudentId = APIClient.Student.Id}).Select(x => new {InterestId = x.Id, InterestName = x.Title}).ToList(); var selectedInterests = diy.DiyInterests.Select(x => x.Key).ToArray(); ViewBag.Interests = new MultiSelectList(interests, "InterestId", "InterestName", selectedInterests); ViewBag.Tasks = _task.ReadList(null); @@ -287,8 +287,9 @@ namespace StudentWebClient.Controllers { diyInterests.Add(id, _interest.ReadElement(new InterestSearchModel { Id = id })); } - _diy.Create(new DiyBindingModel + _diy.Update(new DiyBindingModel { + Id = idDiy, StudentId = APIClient.Student.Id, StudentName = APIClient.Student.Name, Title = title, diff --git a/SchoolAgainStudy/StudentWebClient/Views/Home/DiySetting.cshtml b/SchoolAgainStudy/StudentWebClient/Views/Home/DiySetting.cshtml new file mode 100644 index 0000000..c6ef3eb --- /dev/null +++ b/SchoolAgainStudy/StudentWebClient/Views/Home/DiySetting.cshtml @@ -0,0 +1,41 @@ +@using SchoolAgainStudyContracts.ViewModel; +@model DiyViewModel +@{ + ViewData["Title"] = "Setting"; +} +