User management fixed. Reports working now. Deployed
This commit is contained in:
@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using System.Threading;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
@ -16,7 +18,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
}
|
||||
bool LoginUser(bool setThreadPrincipal)
|
||||
{
|
||||
using (LoginForm login = new LoginForm())
|
||||
using (LoginForm login = new LoginForm(new KeyboardControl()))
|
||||
{
|
||||
string userName;
|
||||
login.ShowDialog();
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.txtUserName = new System.Windows.Forms.TextBox();
|
||||
this.Label1 = new System.Windows.Forms.Label();
|
||||
this.numpadControl1 = new Tanshu.Common.KeyboardControl.NumpadControl();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnExit
|
||||
@ -91,21 +90,12 @@
|
||||
this.Label1.TabIndex = 4;
|
||||
this.Label1.Text = "Username";
|
||||
//
|
||||
// numpadControl1
|
||||
//
|
||||
this.numpadControl1.Location = new System.Drawing.Point(35, 93);
|
||||
this.numpadControl1.Name = "numpadControl1";
|
||||
this.numpadControl1.Size = new System.Drawing.Size(224, 224);
|
||||
this.numpadControl1.TabIndex = 6;
|
||||
this.numpadControl1.TabStop = false;
|
||||
//
|
||||
// LoginForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnExit;
|
||||
this.ClientSize = new System.Drawing.Size(290, 329);
|
||||
this.Controls.Add(this.numpadControl1);
|
||||
this.ClientSize = new System.Drawing.Size(290, 97);
|
||||
this.Controls.Add(this.txtPassword);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.txtUserName);
|
||||
@ -129,6 +119,5 @@
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.TextBox txtUserName;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
private Tanshu.Common.KeyboardControl.NumpadControl numpadControl1;
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using Tanshu.Common.KeyboardControl;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
@ -12,11 +13,24 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private bool isAuthenticated;
|
||||
private string userName;
|
||||
public LoginForm()
|
||||
private IKeyboardControl keyboardControl;
|
||||
public LoginForm(IKeyboardControl keyboardControl)
|
||||
{
|
||||
InitializeComponent();
|
||||
isAuthenticated = false;
|
||||
userName = null;
|
||||
this.keyboardControl = keyboardControl;
|
||||
|
||||
var control = keyboardControl as UserControl;
|
||||
if (control != null)
|
||||
{
|
||||
control.Location = new System.Drawing.Point(6, 87);
|
||||
var border = (this.Width - this.ClientSize.Width) / 2;
|
||||
var titlebarHeight = this.Height - this.ClientSize.Height - (2 * border);
|
||||
this.Controls.Add(control);
|
||||
this.Width = 6 + control.Width + 6 + (border * 2);
|
||||
this.Height = titlebarHeight + 87 + control.Height + 6 + (border * 2);
|
||||
}
|
||||
}
|
||||
|
||||
private void txtUserName_KeyDown(object sender, KeyEventArgs e)
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using System.Configuration;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
static class Session
|
||||
{
|
||||
private static User currentUser;
|
||||
public static bool IsAuthenticated { get; private set; }
|
||||
public static User User
|
||||
{
|
||||
get
|
||||
{
|
||||
return currentUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
currentUser = value;
|
||||
IsAuthenticated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentUser = null;
|
||||
IsAuthenticated = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user