Breaking Changes. Upgrade Script in Sql directory. Deployed
This commit is contained in:
@ -1,24 +1,19 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
|
||||
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 bool isAuthenticated;
|
||||
private string userName;
|
||||
private User user;
|
||||
private IKeyboardControl keyboardControl;
|
||||
public LoginForm(IKeyboardControl keyboardControl)
|
||||
{
|
||||
InitializeComponent();
|
||||
isAuthenticated = false;
|
||||
userName = null;
|
||||
user = null;
|
||||
this.keyboardControl = keyboardControl;
|
||||
|
||||
var control = keyboardControl as UserControl;
|
||||
@ -47,22 +42,17 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void btnLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
userName = txtUserName.Text.Trim();
|
||||
isAuthenticated = UserBI.ValidateUser(userName, Tanshu.Common.Md5.Hash(txtPassword.Text, "v2"));
|
||||
|
||||
if (isAuthenticated)
|
||||
{
|
||||
user = UserBI.ValidateUser(txtUserName.Text.Trim(), Tanshu.Common.Md5.Hash(txtPassword.Text, "v2"));
|
||||
if (user != null)
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Username or password is not valid");
|
||||
|
||||
}
|
||||
|
||||
public bool UserName(out string userName)
|
||||
{
|
||||
userName = this.userName;
|
||||
return isAuthenticated;
|
||||
userName = this.user == null ? "" : this.user.Name;
|
||||
return this.user != null;
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user