|
|
@ -141,8 +141,13 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
[Authorize] |
|
|
|
public async Task<ActionResult> MyProfile() |
|
|
|
public async Task<ActionResult> MyProfile(bool? success) |
|
|
|
{ |
|
|
|
if (success.HasValue) |
|
|
|
{ |
|
|
|
ViewBag.Result = new PostResultViewModel(success.Value, success.Value ? "پروفایل شما با موفقیت ویرایش شد." : "در ویرایش پروفایل شما خطایی رخ داده."); |
|
|
|
} |
|
|
|
|
|
|
|
User u = await UserManager.FindByNameAsync(User.Identity.Name); |
|
|
|
if (u is Avalin) |
|
|
|
{ |
|
|
@ -195,13 +200,13 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
SevominDbContext.Current.SaveChanges(); |
|
|
|
|
|
|
|
return RedirectToAction("MyProfile", new { success = true }); |
|
|
|
} |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
|
|
|
|
return RedirectToAction("MyProfile"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Authorize] |
|
|
|