Skip to content

Commit dceabe4

Browse files
committed
New Yaear commit
1 parent cc30712 commit dceabe4

29 files changed

+62
-21
lines changed
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

EPAM.MyBlog.UI.Web/Controllers/AccountController.cs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,26 @@ public ActionResult TitleState()
143143
return PartialView();
144144
}
145145

146+
[Authorize(Roles = "User")]
147+
public ActionResult DeleteAc()
148+
{
149+
return View();
150+
}
151+
152+
[HttpPost]
153+
public ActionResult DeleteAc(ConfirmModel model)
154+
{
155+
if (ModelState.IsValid)
156+
{
157+
if (model.Confirm)
158+
{
159+
LoginModel.LogOut();
146160

147-
//[Authorize(Roles = "Admin")]
148-
//[ChildActionOnly]
149-
//public ActionResult ModerMenu()
150-
//{
151-
// return PartialView();
152-
//}
153-
154-
//[Authorize(Roles = "Admin")]
155-
//[ChildActionOnly]
156-
//public ActionResult ModerMenu()
157-
//{
158-
// return PartialView();
159-
//}
161+
}
162+
return RedirectToAction("Index", "Home");
163+
}
164+
165+
return View();
166+
}
160167
}
161168
}

EPAM.MyBlog.UI.Web/EPAM.MyBlog.UI.Web.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
<Content Include="Views\Admin\Posts.cshtml" />
190190
<Content Include="Views\Admin\UserComments.cshtml" />
191191
<Content Include="Views\Admin\DeleteComment.cshtml" />
192+
<Content Include="Views\Account\DeleteAc.cshtml" />
192193
</ItemGroup>
193194
<ItemGroup>
194195
<Folder Include="App_Data\" />

EPAM.MyBlog.UI.Web/Models/ConfirmModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
34
using System.Linq;
45
using System.Web;
56

@@ -9,6 +10,11 @@ public class ConfirmModel
910
{
1011
public bool Confirm { get{return confirm;} set{confirm = value;} }
1112

13+
[Display(Name = "Причина удаления (необязательно для заполнения)")]
14+
public string Reason { get { return reason; } set { reason = value; } }
1215
private bool confirm;
16+
private string reason;
17+
18+
1319
}
1420
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@model EPAM.MyBlog.UI.Web.Models.ConfirmModel
2+
3+
@{
4+
ViewBag.Title = "DeleteAc";
5+
}
6+
7+
8+
@using (Html.BeginForm())
9+
{
10+
<div class="editor-label">
11+
@Html.LabelFor(model => model.Reason)
12+
</div>
13+
<div class="editor-field">
14+
@Html.EditorFor(model => model.Reason)
15+
</div>
16+
<h2>Вы действиетльно хотите удалить аккаунт?</h2>
17+
<button name="Confirm" value ="true">Да</button>
18+
<button name="Confirm" value ="false">Нет</button>
19+
20+
21+
}
22+
23+
@*@section Scripts {
24+
@Scripts.Render("~/bundles/jqueryval")
25+
}*@

EPAM.MyBlog.UI.Web/Views/Account/MenuState.cshtml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Посты <span class="caret"></span></a>
66
<ul class="dropdown-menu" role="menu">
77
<li><a href="@Url.Action("Index", "Post")">Мои посты</a></li>
8-
<li><a href="#">Избранное</a></li>
9-
<li class="divider"></li>
10-
<li><a href="#">Посты друзей</a></li>
11-
8+
<li><a href="@Url.Action("Favorite", "Post")">Избранное</a></li>
9+
<li><a href="#">Лента</a></li>
10+
</ul>
11+
</li>
12+
<li class="dropdown">
13+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Аккаунт <span class="caret"></span></a>
14+
<ul class="dropdown-menu" role="menu">
15+
<li><a href="@Url.Action("AboutMe", "Account")">О себе</a></li>
16+
<li><a href="@Url.Action("DeleteAc", "Account")">Удалить аккаунт</a></li>
1217
</ul>
1318
</li>
14-
<li><a href="#">Лента</a></li>
15-
<li><a href="#">Аккаунт</a></li>
16-
<li><a href="#">Помощь</a></li>
19+
<li><a href="@Url.Action("Help", "Account")">Помощь</a></li>
1720
@if (User.IsInRole("Moder"))
1821
{
1922
@Html.Partial("~/Views/Admin/ModerMenu.cshtml")
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

EPAM.MyBlog.UI.Web/bin/Entities.dll

0 Bytes
Binary file not shown.

EPAM.MyBlog.UI.Web/bin/Entities.pdb

0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
512 Bytes
Binary file not shown.
Binary file not shown.

EPAM.MyBlog.v11.suo

12.5 KB
Binary file not shown.

Entities/bin/Debug/Entities.dll

0 Bytes
Binary file not shown.

Entities/bin/Debug/Entities.pdb

0 Bytes
Binary file not shown.

Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ C:\Users\Jem\Documents\Visual Studio 2012\Projects\Blog\Entities\bin\Debug\log4n
1010
C:\Users\Jem\Documents\Visual Studio 2012\Projects\Blog\Entities\bin\Debug\log4net.xml
1111
C:\Users\Jem\Documents\Visual Studio 2012\Projects\Blog\Entities\obj\Debug\Entities.dll
1212
C:\Users\Jem\Documents\Visual Studio 2012\Projects\Blog\Entities\obj\Debug\Entities.pdb
13-
C:\Users\Jem\Documents\Visual Studio 2012\Projects\Blog\Entities\obj\Debug\Entities.csprojResolveAssemblyReference.cache

Entities/obj/Debug/Entities.dll

0 Bytes
Binary file not shown.

Entities/obj/Debug/Entities.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)