|
|
@ -245,7 +245,7 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Authorize] |
|
|
|
[Authorize(Roles = "Avalin,Dovomin")] |
|
|
|
public async Task<ActionResult> MyProfile(bool? success) |
|
|
|
{ |
|
|
|
if (success.HasValue) |
|
|
@ -266,7 +266,7 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Authorize] |
|
|
|
[Authorize(Roles = "Dovomin")] |
|
|
|
[HttpPost] |
|
|
|
public async Task<ActionResult> ProfileDovomin(string JalaliBirthDate, string FirstName, |
|
|
|
string LastName, string ContactPersonEMail, bool IsFullTime, |
|
|
@ -314,7 +314,7 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Authorize] |
|
|
|
[Authorize(Roles = "Avalin")] |
|
|
|
[HttpPost] |
|
|
|
public async Task<ActionResult> ProfileAvalin(string CompanyName, string NationalId, string RegisterId, |
|
|
|
string Address, string CompanyPhoneNumber, string EMail) |
|
|
@ -350,23 +350,27 @@ namespace Sevomin.WebFrontend.Controllers |
|
|
|
if ((user as Dovomin) == null) |
|
|
|
return HttpNotFound(); |
|
|
|
|
|
|
|
if (User.IsInRole("Dovomin")) |
|
|
|
if (!User.IsInRole("God")) |
|
|
|
{ |
|
|
|
if (userId != user.Id) |
|
|
|
if (User.IsInRole("Dovomin")) |
|
|
|
{ |
|
|
|
return HttpNotFound(); |
|
|
|
if (userId != user.Id) |
|
|
|
{ |
|
|
|
return HttpNotFound(); |
|
|
|
} |
|
|
|
else { } |
|
|
|
} |
|
|
|
else if (User.IsInRole("Avalin")) |
|
|
|
{ |
|
|
|
Avalin avalin = (await UserManager.FindByNameAsync(User.Identity.Name)) as Avalin; |
|
|
|
bool showIt = avalin.Jobs.Any(j => |
|
|
|
{ |
|
|
|
bool ret = j.Applications.Any(c => c.DovominId == userId); |
|
|
|
return ret; |
|
|
|
}); |
|
|
|
if (!showIt) |
|
|
|
return HttpNotFound(); |
|
|
|
} |
|
|
|
else { } |
|
|
|
} |
|
|
|
else if (User.IsInRole("Avalin")) |
|
|
|
{ |
|
|
|
Avalin avalin = (await UserManager.FindByNameAsync(User.Identity.Name)) as Avalin; |
|
|
|
bool showIt = avalin.Jobs.Any(j => { |
|
|
|
bool ret = j.Applications.Any(c => c.DovominId == userId); |
|
|
|
return ret; |
|
|
|
}); |
|
|
|
if (!showIt) |
|
|
|
return HttpNotFound(); |
|
|
|
} |
|
|
|
|
|
|
|
return View(new DovominViewModel(user as Dovomin)); |
|
|
|