2011-01-06 07:17:00 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using Tanshu.Accounts.Repository;
|
2011-01-06 07:17:00 +00:00
|
|
|
|
using System.Threading;
|
2011-02-09 12:03:22 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
|
using Tanshu.Common.KeyboardControl;
|
2011-01-06 07:17:00 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.PointOfSale
|
|
|
|
|
{
|
|
|
|
|
class KeyboardLogin : ILogin
|
|
|
|
|
{
|
|
|
|
|
public bool LoginUser()
|
|
|
|
|
{
|
|
|
|
|
return LoginUser(true);
|
|
|
|
|
}
|
2014-11-02 08:03:31 +00:00
|
|
|
|
bool LoginUser(bool setSession)
|
2011-01-06 07:17:00 +00:00
|
|
|
|
{
|
2014-11-02 08:03:31 +00:00
|
|
|
|
using (LoginForm frm = new LoginForm(new KeyboardControl()))
|
2011-01-06 07:17:00 +00:00
|
|
|
|
{
|
2014-11-02 08:03:31 +00:00
|
|
|
|
frm.ShowDialog();
|
|
|
|
|
var user = frm.User();
|
|
|
|
|
if (user != null && setSession)
|
|
|
|
|
{
|
|
|
|
|
Session.User = user;
|
|
|
|
|
}
|
|
|
|
|
return user != null;
|
2011-01-06 07:17:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool LogoutUser()
|
|
|
|
|
{
|
|
|
|
|
Session.User = null;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|