Numpad User Control and Login Changes
This commit is contained in:
@ -110,11 +110,11 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void AssignRoles_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
string userName = Thread.CurrentPrincipal.Identity.Name;
|
||||
AccountsPrincipal principal = AccountsPrincipal.CreateAccountsPrincipal(new MembershipBI().GetRolesForUser(userName), new MembershipBI().GetUserFromName(userName));
|
||||
//string userName = Thread.CurrentPrincipal.Identity.Name;
|
||||
//AccountsPrincipal principal = AccountsPrincipal.CreateAccountsPrincipal(new MembershipBI().GetRolesForUser(userName), new MembershipBI().GetUserFromName(userName));
|
||||
|
||||
// bind the generic principal to the thread
|
||||
Thread.CurrentPrincipal = principal;
|
||||
//// bind the generic principal to the thread
|
||||
//Thread.CurrentPrincipal = principal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void ChangePassword_Load(object sender, EventArgs e)
|
||||
{
|
||||
txtUsername.Text = CurrentUser.user.Name;
|
||||
txtUsername.Text = Session.User.Name;
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
|
||||
@ -13,16 +13,26 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
{ }
|
||||
public static RoleBI GetRoleBI(string roleID)
|
||||
{
|
||||
RoleBI roleBI = new RoleBI(roleID, CurrentUser.user.UserID);
|
||||
if (!roleBI.IsAllowed)
|
||||
{
|
||||
using (LoginForm frm = new LoginForm())
|
||||
{
|
||||
frm.ShowDialog();
|
||||
roleBI.Evelvate(frm.UserName);
|
||||
}
|
||||
}
|
||||
RoleBI roleBI;
|
||||
if (Session.User != null)
|
||||
roleBI = new RoleBI(roleID, Session.User.UserID);
|
||||
else
|
||||
roleBI = new RoleBI(roleID, new Guid());
|
||||
return roleBI;
|
||||
//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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user