Skip to content

Commit 8d2e0ae

Browse files
18th commit
Updating interests
1 parent f8b5990 commit 8d2e0ae

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

MvcCV/Controllers/InterestsController.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ public ActionResult DeleteInterest(int id)
3737
db.SaveChanges();
3838
return RedirectToAction("Index");
3939
}
40+
public ActionResult BringInterest(int id)
41+
{
42+
var interest = db.TBLINTERESTS.Find(id);
43+
return View("BringInterest", interest);
44+
}
45+
public ActionResult UpdateInterest(TBLINTERESTS p)
46+
{
47+
var data = db.TBLINTERESTS.Find(p.ID);
48+
data.INTEREST = p.INTEREST;
49+
db.SaveChanges();
50+
return RedirectToAction("Index");
51+
52+
}
4053
}
4154

4255

MvcCV/MvcCV.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
<Content Include="Views\Experiences\BringExperience.cshtml" />
325325
<Content Include="Views\Education\BringEducation.cshtml" />
326326
<Content Include="Views\Skills\BringSkill.cshtml" />
327+
<Content Include="Views\Interests\BringInterest.cshtml" />
327328
</ItemGroup>
328329
<ItemGroup>
329330
<Folder Include="App_Data\" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@model MvcCV.Models.Entity.TBLINTERESTS
2+
@{
3+
ViewBag.Title = "BringInterest";
4+
Layout = "~/Views/Shared/_MainLayout.cshtml";
5+
}
6+
7+
@using (Html.BeginForm("UpdateInterest", "Interests", 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.INTEREST)
14+
@Html.TextBoxFor(m => m.INTEREST, new { @class = "form-control" })
15+
<br />
16+
<button class="btn btn-primary">Update</button>
17+
</div>
18+
}
19+

0 commit comments

Comments
 (0)