Numpad User Control and Login Changes

This commit is contained in:
unknown
2011-01-06 12:47:00 +05:30
parent 232a62f8ca
commit e32e9f9e74
47 changed files with 1536 additions and 714 deletions

View File

@ -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;
}
}
}

View File

@ -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)

View File

@ -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;
}
}
}