change-登录优化

main
liuwf 9 months ago
parent c029823763
commit 9efa0eef0a

@ -529,24 +529,9 @@ namespace Aucma.Core.BoxFoam.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
if (startflag) TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
{ CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
startflag = false;
try
{
DateTime now = DateTime.Now;
CurrentDateTime = now.ToString("yyyy-MM-dd HH:mm:ss");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
startflag = true;
}
}
})); }));
} }

@ -64,7 +64,8 @@ namespace Aucma.Core.BoxFoam.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -571,6 +571,7 @@ namespace Aucma.Core.CodeBinding.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -64,7 +64,8 @@ namespace Aucma.Core.CodeBinding.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -561,6 +561,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -63,7 +63,8 @@ namespace Aucma.Core.DoorFoam.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -32,11 +32,10 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
public MainWindowViewModel() public MainWindowViewModel()
{ {
UserContent = oldBoxFoamPage; UserContent = oldBoxFoamPage;
// 创建一个DispatcherTimer对象 DispatcherTimer timer2 = new DispatcherTimer();
DispatcherTimer timer = new DispatcherTimer(); timer2.Interval = new TimeSpan(0, 0, 1); //间隔1秒
timer.Interval = TimeSpan.FromSeconds(1); timer2.Tick += new EventHandler(timer_Tick);
timer.Tick += Timer_Tick; timer2.Start();
timer.Start();
Task.Run(() => Task.Run(() =>
{ {
@ -529,21 +528,15 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
set => SetProperty(ref _shiftStr, value); set => SetProperty(ref _shiftStr, value);
} }
private void Timer_Tick(object sender, EventArgs e) void timer_Tick(object sender, EventArgs e)
{ {
DateTime now = DateTime.Now; System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
// 判断当前是否是白班时间段
if (now.Hour >= 8 && now.Hour < 20)
{
ShiftStr = $"白班 08点-20点";
}
else
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}));
ShiftStr = $"夜班 20点-08点";
}
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
} }
} }
} }

@ -62,7 +62,8 @@ namespace Aucma.Core.OldBoxFoam.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -474,6 +474,7 @@ namespace Aucma.Core.Palletiz.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -63,7 +63,8 @@ namespace Aucma.Core.Palletiz.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -475,6 +475,7 @@ namespace Aucma.Core.PalletizCX1.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -63,7 +63,8 @@ namespace Aucma.Core.PalletizCX1.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -268,6 +268,7 @@ namespace Aucma.Core.PrintTo.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -62,7 +62,8 @@ namespace Aucma.Core.PrintTo.Views
return; return;
} }
// 登录校验 // 登录校验
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers,userName, passWord,this); loginViewModel.Login(teamMembers,userName, passWord,this);
} }

@ -383,6 +383,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -83,7 +83,8 @@ namespace Aucma.Core.ProductOffLine.Views
return; return;
} }
} }
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers, barCode,userName, passWord, this); loginViewModel.Login(teamMembers, barCode,userName, passWord, this);
} }

@ -87,6 +87,7 @@ namespace Aucma.Core.ProductOffLineCX1.ViewModels
{ {
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{ {
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account} 条码系统: {appConfig.BarCodeAccount}";
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
})); }));

@ -80,7 +80,8 @@ namespace Aucma.Core.ProductOffLineCX1.Views
return; return;
} }
} }
txtUserName.Text = "";
txtPassword.Password = "";
loginViewModel.Login(teamMembers, barCode,userName, passWord, this); loginViewModel.Login(teamMembers, barCode,userName, passWord, this);
} }

Loading…
Cancel
Save