Files
BeWoPlaner/Data/SessionFacade.cs
2016-06-27 01:45:38 +02:00

46 lines
1.0 KiB
C#

using System.Web;
using BeWo.Data.Entities;
namespace BeWo.Data
{
public static class SessionFacade
{
public static ApplicationUser LoggedInUser
{
get
{
return HttpContext.Current.Session["apuser"] as ApplicationUser;
}
set
{
HttpContext.Current.Session["apuser"] = value;
}
}
public static string Tenant
{
get
{
return HttpContext.Current.Session["tenant"] as string;
}
set
{
HttpContext.Current.Session["tenant"] = value;
}
}
public static bool IsUserLoggedIn()
{
return LoggedInUser != null;
}
public static void LogUserOut()
{
HttpContext.Current.Session["apuser"] = null;
HttpContext.Current.Session.Abandon();
}
}
}