Files
Backend-Api/ServiceHost/Areas/Camera/Pages/ErrorMessage.cshtml.cs
2024-09-23 16:15:53 +03:30

33 lines
960 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");
}
}
}