File tree Expand file tree Collapse file tree 4 files changed +45
-1
lines changed
Expand file tree Collapse file tree 4 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -39,5 +39,20 @@ public ActionResult DeleteExperience(int id)
3939 db . SaveChanges ( ) ;
4040 return RedirectToAction ( "Index" ) ;
4141 }
42+ public ActionResult BringExperience ( int id )
43+ {
44+ var data = db . TBLEXPERIENCE . Find ( id ) ;
45+ return View ( "BringExperience" , data ) ;
46+ }
47+ public ActionResult UpdateExperience ( TBLEXPERIENCE p )
48+ {
49+ var datas = db . TBLEXPERIENCE . Find ( p . ID ) ;
50+ datas . TITLE = p . TITLE ;
51+ datas . SUBTITLE = p . SUBTITLE ;
52+ datas . DETAILS = p . DETAILS ;
53+ datas . DATE = p . DATE ;
54+ db . SaveChanges ( ) ;
55+ return RedirectToAction ( "Index" ) ;
56+ }
4257 }
4358}
Original file line number Diff line number Diff line change 321321 <Content Include =" Views\Interests\NewInterest.cshtml" />
322322 <Content Include =" Views\Certificates\NewCertificate.cshtml" />
323323 <Content Include =" Views\About\BringData.cshtml" />
324+ <Content Include =" Views\Experiences\BringExperience.cshtml" />
324325 </ItemGroup >
325326 <ItemGroup >
326327 <Folder Include =" App_Data\" />
Original file line number Diff line number Diff line change 1+ @model MvcCV .Models .Entity .TBLEXPERIENCE
2+ @{
3+ ViewBag .Title = " BringExperience" ;
4+ Layout = " ~/Views/Shared/_MainLayout.cshtml" ;
5+ }
6+
7+ @using (Html .BeginForm (" UpdateExperience" , " Experiences" , 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 .DATE )
20+ @Html.TextBoxFor(m => m .DATE , new { @class = " form-control" } )
21+ <br />
22+ @Html.LabelFor(m => m .DETAILS )
23+ @Html.TextAreaFor(m => m .DETAILS , 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.DATE </td >
2727 <td >@x.DETAILS </td >
2828 <td ><a href =" /Experiences/DeleteExperience/@x.ID" class =" btn btn-danger" >Delete </a ></td >
29- <td ><a href =" # " class =" btn btn-success" >Update </a ></td >
29+ <td ><a href =" /Experiences/BringExperience/@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