File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed
Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -38,5 +38,21 @@ public ActionResult DeleteEducation(int id)
3838 db . SaveChanges ( ) ;
3939 return RedirectToAction ( "Index" ) ;
4040 }
41+ public ActionResult BringEducation ( int id )
42+ {
43+ var education = db . TBLEDUCATION . Find ( id ) ;
44+ return View ( "BringEducation" , education ) ;
45+ }
46+ public ActionResult UpdateEducation ( TBLEDUCATION p )
47+ {
48+ var data = db . TBLEDUCATION . Find ( p . ID ) ;
49+ data . TITLE = p . TITLE ;
50+ data . SUBTITLE = p . SUBTITLE ;
51+ data . DEPARTMENT = p . DEPARTMENT ;
52+ data . GPA = p . GPA ;
53+ db . SaveChanges ( ) ;
54+ return RedirectToAction ( "Index" ) ;
55+
56+ }
4157 }
4258}
Original file line number Diff line number Diff line change 322322 <Content Include =" Views\Certificates\NewCertificate.cshtml" />
323323 <Content Include =" Views\About\BringData.cshtml" />
324324 <Content Include =" Views\Experiences\BringExperience.cshtml" />
325+ <Content Include =" Views\Education\BringEducation.cshtml" />
325326 </ItemGroup >
326327 <ItemGroup >
327328 <Folder Include =" App_Data\" />
Original file line number Diff line number Diff line change 1+ @model MvcCV .Models .Entity .TBLEDUCATION
2+ @{
3+ ViewBag .Title = " BringEducation" ;
4+ Layout = " ~/Views/Shared/_MainLayout.cshtml" ;
5+ }
6+
7+ @using (Html .BeginForm (" UpdateEducation" , " Education" , FormMethod .Post ))
8+ {
9+ <div class =" form-group" >
10+ @Html.LabelFor(m => m .ID )
11+ @Html.TextBoxFor(m => m .ID , new { @class = " form-control" } )
12+ <br />
13+ @Html.LabelFor(m => m .TITLE )
14+ @Html.TextBoxFor(m => m .TITLE , new { @class = " form-control" } )
15+ <br />
16+ @Html.LabelFor(m => m .SUBTITLE )
17+ @Html.TextBoxFor(m => m .SUBTITLE , new { @class = " form-control" } )
18+ <br />
19+ @Html.LabelFor(m => m .DEPARTMENT )
20+ @Html.TextBoxFor(m => m .DEPARTMENT , new { @class = " form-control" } )
21+ <br />
22+ @Html.LabelFor(m => m .GPA )
23+ @Html.TextBoxFor(m => m .GPA , new { @class = " form-control" } )
24+ <br />
25+ <button class =" btn btn-primary" >Update </button >
26+ </div >
27+
28+ }
Original file line number Diff line number Diff line change 2626 <td >@x.DEPARTMENT </td >
2727 <td >@x.GPA </td >
2828 <td ><a href =" /Education/DeleteEducation/@x.ID" class =" btn btn-danger" >Delete </a > </td >
29- <td ><a href =" /Education/DeleteEducation /@x.ID" class =" btn btn-success" >Update </a ></td >
29+ <td ><a href =" /Education/BringEducation /@x.ID" class =" btn btn-success" >Update </a ></td >
3030 </tr >
3131 }
3232 </tbody >
You can’t perform that action at this time.
0 commit comments