Initial Json commit from 2 years ago
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Security.Authentication;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
|
||||
@ -40,12 +41,15 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void btnLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new UserBI())
|
||||
_user = bi.ValidateUser(txtUserName.Text.Trim(), txtPassword.Text);
|
||||
if (_user != null)
|
||||
try
|
||||
{
|
||||
_user = UserBI.ValidateUser(txtUserName.Text.Trim(), txtPassword.Text);
|
||||
this.Close();
|
||||
else
|
||||
MessageBox.Show("Username or password is not valid");
|
||||
}
|
||||
catch (AuthenticationException ex)
|
||||
{
|
||||
MessageBox.Show("Username or password is not valid\n" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public User User()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using Tanshu.Accounts.Repository;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
@ -23,17 +23,14 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
if (!register)
|
||||
{
|
||||
using (var bi = new UserBI())
|
||||
var user = UserBI.MsrValidateUser(_loginString);
|
||||
if (user != null)
|
||||
{
|
||||
var user = bi.MsrValidateUser(_loginString);
|
||||
if (user != null)
|
||||
{
|
||||
this._user = user;
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Unrecognised Card");
|
||||
this._user = user;
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
MessageBox.Show("Unrecognised Card");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user