narsil/Tanshu.Accounts.PointOfSale/Authentication/MsrLogin.cs
unknown d8ecec8bb6 Added inverse Attribute to ProductGroup.
BillInventory Renamed.
Refactored Bill to be more usable.
Added Bill Detail Report.
Added Open Bill and Bill Details Roles.
Zero Rate Products have Yellow background Color.
Refactored UserBI, FoodTableBI, ModifierBI, PrintLocationBI, ProductBI, ProductGroupBI, TaxBI, UserBI,
Cached the Products List.
Product and Product Group Form Working.
2011-06-23 18:17:48 +05:30

36 lines
1018 B
C#

using Tanshu.Accounts.Repository;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.PointOfSale
{
class MsrLogin : ILogin
{
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public bool LoginUser()
{
return LoginUser(true);
}
static bool LoginUser(bool setThreadPrincipal)
{
using (var frm = new MsrLoginForm(false))
{
string userName;
frm.ShowDialog();
var authenticated = frm.UserName(out userName);
if (authenticated && setThreadPrincipal)
using (var bi = new UserBI())
Session.User = bi.Get(x => x.Name == userName);
return authenticated;
}
}
public bool LogoutUser()
{
Session.User = null;
return true;
}
}
}