using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace RestaurantWeb2.Pages;
public class IndexModel : PageModel {
    public string Err = "";
    public IActionResult OnPost(string role, string pass) {
        if ((role=="admin"&&pass=="admin")||(role=="manager"&&pass=="manager")||(role=="waiter"&&pass=="waiter")) {
            HttpContext.Session.SetString("role", role);
            return RedirectToPage("/Data", new{table="Персонал"});
        }
        Err = "Неверный пароль"; return Page();
    }
}
