31 lines
822 B
C#
31 lines
822 B
C#
using AccountManagement.Application.Contracts.Account;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
namespace ServiceHost.Areas.Camera.Pages;
|
|
|
|
public class ErrorMessageModel : PageModel
|
|
{
|
|
private readonly IAccountApplication _accountApplication;
|
|
|
|
public ErrorMessageModel(IAccountApplication accountApplication)
|
|
{
|
|
_accountApplication = accountApplication;
|
|
}
|
|
|
|
public string Message { get; set; }
|
|
public void OnGet(string message)
|
|
{
|
|
if (message == "ServiceNotFound")
|
|
Message = "شما سرویس فعال ندارید.";
|
|
|
|
if (message == "EmployeeNotFound")
|
|
Message = "شما هیچ پرسنلی را به حضور غیاب اضافه نکردهاید.";
|
|
}
|
|
|
|
public IActionResult OnGetLogout()
|
|
{
|
|
_accountApplication.Logout();
|
|
return RedirectToPage("/Index");
|
|
}
|
|
} |