Moved to fluent. Added support for Modifiers. Fixtures to load intial test data
This commit is contained in:
@ -2,14 +2,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Tanshu.Accounts.BI;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using System.Threading;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
class KeyboardLogin : ILogin
|
||||
{
|
||||
private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public bool LoginUser()
|
||||
{
|
||||
return LoginUser(true);
|
||||
@ -35,11 +35,11 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
}
|
||||
static void SetThreadPrincipal(string userName)
|
||||
{
|
||||
log.Warn(string.Format("User Login: '{0}'", userName));
|
||||
//log.Warn(string.Format("User Login: '{0}'", userName));
|
||||
if (userName.Contains(":"))
|
||||
userName = userName.Substring(userName.IndexOf(":") + 1);
|
||||
|
||||
Session.User = new MembershipBI().GetUserFromName(userName);
|
||||
Session.User = UserBI.GetUserFromName(userName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.BI;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
@ -9,7 +9,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
public partial class LoginForm : Form
|
||||
{
|
||||
//size: 296, 123
|
||||
private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private bool isAuthenticated;
|
||||
private string userName;
|
||||
public LoginForm()
|
||||
@ -34,7 +34,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
private void btnLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
userName = txtUserName.Text.Trim();
|
||||
isAuthenticated = new MembershipBI().ValidateUser(userName, Tanshu.Common.Md5.Hash(txtPassword.Text, "Salt"));
|
||||
isAuthenticated = UserBI.ValidateUser(userName, Tanshu.Common.Md5.Hash(txtPassword.Text, "v2"));
|
||||
|
||||
if (isAuthenticated)
|
||||
{
|
||||
|
||||
@ -3,16 +3,17 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.BI;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using System.Configuration;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
static class Session
|
||||
{
|
||||
private static UserBO currentUser;
|
||||
private static User currentUser;
|
||||
public static bool IsAuthenticated { get; private set; }
|
||||
public static UserBO User
|
||||
public static User User
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user