|
@ -141,8 +141,13 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Authorize] |
|
|
[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); |
|
|
User u = await UserManager.FindByNameAsync(User.Identity.Name); |
|
|
if (u is Avalin) |
|
|
if (u is Avalin) |
|
|
{ |
|
|
{ |
|
@ -195,13 +200,13 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SevominDbContext.Current.SaveChanges(); |
|
|
SevominDbContext.Current.SaveChanges(); |
|
|
|
|
|
|
|
|
|
|
|
return RedirectToAction("MyProfile", new { success = true }); |
|
|
} |
|
|
} |
|
|
catch (Exception) |
|
|
catch (Exception) |
|
|
{ |
|
|
{ |
|
|
throw; |
|
|
throw; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return RedirectToAction("MyProfile"); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Authorize] |
|
|
[Authorize] |
|
|