Automated teller machine emulation.
using System.Web;
using SergeyDrozdovATM.BLL;
namespace SergeyDrozdovATM.Web
{
public static class AuthenticationHelper
{
public static User GetLoggedUser()
{
if (HttpContext.Current.Session["LoggedUser"] != null)
{
return (User) HttpContext.Current.Session["LoggedUser"];
}
return null;
}
public static bool IsAuthenticated()
{
return HttpContext.Current.Session["LoggedUser"] != null;
}
}
}