DataServices 现场调试OK
This commit is contained in:
@@ -182,9 +182,14 @@ namespace FATrace.App
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户名
|
||||
/// 当前确认者用户名
|
||||
/// </summary>
|
||||
public string CurrentOperationNo { get; set; } = string.Empty;
|
||||
public string CurrentCheckUserNo { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 当前操作者用户名
|
||||
/// </summary>
|
||||
public string CurrentOpUserNo { get; set; } = string.Empty;
|
||||
|
||||
public string CurrentOperationNoUserLevel { get; set; } = string.Empty;
|
||||
|
||||
@@ -696,13 +701,14 @@ namespace FATrace.App
|
||||
Batch = CurSelectedRawProInput.Batch,
|
||||
InBagCode = Code,
|
||||
BoxCode = Code + ",A",
|
||||
OpUser = CurrentOperationNo,
|
||||
CheckUser = CurrentOperationNo,
|
||||
OpUser = CurrentOpUserNo,
|
||||
CheckUser = CurrentCheckUserNo,
|
||||
RawCode = CurSelectedRawProInput.RawCode,
|
||||
ShelfLife = CurSelectedRawProInput.ShelfLife,
|
||||
RawName = CurSelectedRawProInput.RawName,
|
||||
RemainWeight = NewRemainWeight,
|
||||
Weight = CurWeight,
|
||||
DeliveryDate= DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
WeightTime = DateTime.Now,
|
||||
StockWeight = CurSelectedRawProInput.Weight,
|
||||
}).ExecuteAffrows();
|
||||
@@ -714,7 +720,7 @@ namespace FATrace.App
|
||||
txtRemainWeight.Text = CurSelectedRawProInput.RemainWeight.ToString();
|
||||
|
||||
//称重检查,如果剩余重量为0,进行提示,当剩余的重量小于称重的重量,进行提示
|
||||
if (CurSelectedRawProInput.RemainWeight < CurWeight / 1000)
|
||||
if (CurSelectedRawProInput.RemainWeight < CurWeight / 1000.0)
|
||||
{
|
||||
//剩余的重量小于称重的重量,进行提示,强制进行清零
|
||||
Task.Run(() =>
|
||||
@@ -928,9 +934,14 @@ namespace FATrace.App
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(txtUserName.Text))
|
||||
if (string.IsNullOrEmpty(txtCheckUserName.Text))
|
||||
{
|
||||
MessageBox.Show("请输入用户名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show("请输入确认者用户名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtOpName.Text))
|
||||
{
|
||||
MessageBox.Show("请输入操作者用户名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(txtPassword.Text))
|
||||
@@ -939,17 +950,17 @@ namespace FATrace.App
|
||||
return;
|
||||
}
|
||||
|
||||
var ListUser = FSqlContext.FDb.Select<TbUser>().Where(a => a.UserName == txtUserName.Text.Trim()).ToList();
|
||||
var ListUser = FSqlContext.FDb.Select<TbUser>().Where(a => a.UserName == txtCheckUserName.Text.Trim()).ToList();
|
||||
if (ListUser != null && ListUser.Count() > 0)
|
||||
{
|
||||
if (ListUser.FirstOrDefault().Password == txtPassword.Text.Trim())
|
||||
{
|
||||
MessageBox.Show("登录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Main_PopUserNameEvent(txtPassword.Text.Trim(), ListUser.FirstOrDefault().AccessLevel);
|
||||
Main_PopUserNameEvent(txtCheckUserName.Text.Trim(), txtOpName.Text.Trim(), ListUser.FirstOrDefault().AccessLevel);
|
||||
|
||||
this.TabControlMain.SelectedIndex = 0;
|
||||
|
||||
txtUserName.Text = "";
|
||||
txtCheckUserName.Text = "";
|
||||
txtPassword.Text = "";
|
||||
//PopUserNameEvent(txtUserName.Text.Trim());
|
||||
//this.Close();
|
||||
@@ -977,15 +988,17 @@ namespace FATrace.App
|
||||
/// 用户登录的事件发布方法
|
||||
/// </summary>
|
||||
/// <param name="UserName"></param>
|
||||
private void Main_PopUserNameEvent(string UserName, string UserLevel)
|
||||
private void Main_PopUserNameEvent(string CheckUserName, string OpUserName, string UserLevel)
|
||||
{
|
||||
try
|
||||
{
|
||||
CurrentOperationNo = UserName;
|
||||
CurrentCheckUserNo = CheckUserName;
|
||||
CurrentOpUserNo = OpUserName;
|
||||
|
||||
CurrentOperationNoUserLevel = UserLevel;
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
tslCurrentUser.Text = "当前用户:" + CurrentOperationNo;
|
||||
tslCurrentUser.Text = "确认者用户:" + CurrentCheckUserNo;
|
||||
tslCurrentUser.BackColor = Color.Green;
|
||||
tslCurrentUser.ForeColor = Color.White;
|
||||
}));
|
||||
@@ -1006,7 +1019,7 @@ namespace FATrace.App
|
||||
|
||||
private void btnSysConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CurrentOperationNo))
|
||||
if (!string.IsNullOrEmpty(CurrentCheckUserNo))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1048,7 +1061,7 @@ namespace FATrace.App
|
||||
|
||||
private void btnMain_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CurrentOperationNo))
|
||||
if (!string.IsNullOrEmpty(CurrentCheckUserNo))
|
||||
{
|
||||
TabControlMain.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user