2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using Tanshu.Accounts.Repository;
|
2011-02-09 12:03:22 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.PointOfSale
|
|
|
|
|
{
|
|
|
|
|
public class RoleFactoryBI
|
|
|
|
|
{
|
|
|
|
|
private RoleFactoryBI()
|
|
|
|
|
{ }
|
2011-02-09 12:03:22 +00:00
|
|
|
|
private static RoleBI GetRoleBI(RoleConstants role)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-01-06 07:17:00 +00:00
|
|
|
|
RoleBI roleBI;
|
|
|
|
|
if (Session.User != null)
|
2011-02-09 12:03:22 +00:00
|
|
|
|
roleBI = new RoleBI(role.Role, Session.User.UserID);
|
2011-01-06 07:17:00 +00:00
|
|
|
|
else
|
2011-02-09 12:03:22 +00:00
|
|
|
|
roleBI = new RoleBI(role.Role, -1);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
return roleBI;
|
2011-01-06 07:17:00 +00:00
|
|
|
|
//bool repeat = true;
|
|
|
|
|
//while (!roleBI.IsAllowed && repeat)
|
|
|
|
|
//{
|
|
|
|
|
// using (LoginForm frm = new LoginForm())
|
|
|
|
|
// {
|
|
|
|
|
// frm.ShowDialog();
|
|
|
|
|
// string userName;
|
|
|
|
|
// if (frm.Cancelled)
|
|
|
|
|
// repeat = false;
|
|
|
|
|
// else if (frm.UserName(out userName))
|
|
|
|
|
// roleBI.Evelvate(frm.UserName);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//return roleBI;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|