private void timer1_Tick(object sender, EventArgs e) { try { datetimeLb.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm"); if (!DbAccess.IsSystemOnline()) { setStatusBox("系统Offline"); return; } else { if (statusBox.Text == "系统Offline") { setStatusBox(string.Empty); } } if (!isOperating) { checkStockInMode(); touCyaKu = DbAccess.GetTouCyaKu(GlobalAccess.StationNo); if (touCyaKu != null) { if (DoTouCyaKu(touCyaKu)) { weightLoadBtn.PerformClick(); if (!manCheck.Checked && !isRangeError) { if (statusBox.Text == "空箱登录模式" || itemCountBox.Value > 0) { setBtn.PerformClick(); } else { exportBtn.PerformClick(); } } } } else { ClearAll(); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }
private void timer1_Tick(object sender, EventArgs e) { try { datetimeLb.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm"); if (!DbAccess.IsSystemOnline()) { setStatusBox("系统Offline"); return; } else { if (statusBox.Text == "系统Offline") { setStatusBox(string.Empty); } } FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo); if (station == null) { return; } if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket) { setStatusBox("空箱登录模式"); } else if (station.NYUSYUMODE == Nyusyumode.Normal) //入库模式 { if (string.IsNullOrEmpty(statusBox.Text.Trim()) || statusBox.Text == "空箱登录模式") { setStatusBox("正常"); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }