private void DoQuery() { WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider); DBDateTime now = FormatHelper.GetNowDBDateTime(this.DataProvider); //Exception Label labelException = new Label(); labelException.Text = string.Empty; object[] exceptionArray = watchPanelFacade.QueryExceptionList(string.Empty, now.DBDate); if (exceptionArray != null) { for (int i = 0; i < exceptionArray.Length; i++) { ExceptionEventWithDescription exception = (ExceptionEventWithDescription)exceptionArray[i]; if (labelException.Text.Trim().Length > 0) { labelException.Text += "<br>"; } int seq = i + 1; labelException.Text += seq.ToString() + ": "; labelException.Text += exception.SSCode + " - " + exception.SSDesc + " - " + exception.ItemCode + " - " + exception.Description + " - " + exception.Memo; labelException.Text += "(" + FormatHelper.ToTimeString(exception.BeginTime) + " - " + FormatHelper.ToTimeString(exception.EndTime) + ")"; } } this.PanelException.Controls.Add(labelException); }
//异常信息 private string GetExceptionMessageList(string bigSSCode) { string exceptionMessageList = string.Empty; WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider); object[] exceptionList = watchPanelFacade.QueryExceptionList(bigSSCode, GetShiftDay(bigSSCode)); if (exceptionList != null && exceptionList.Length > 0) { string cuerrtExecptionMessage = string.Empty; int showNumber = 1; foreach (ExceptionEventWithDescription obj in exceptionList) { cuerrtExecptionMessage = obj.ItemCode + "-" + obj.Description + "-" + obj.Memo + "(" + FormatHelper.ToTimeString(obj.BeginTime, ":") + "-" + FormatHelper.ToTimeString(obj.EndTime, ":") + ")" + "\r\n"; exceptionMessageList += showNumber.ToString() + ": " + cuerrtExecptionMessage; showNumber += 1; } } return(exceptionMessageList); }
//刷新异常信息 private void RefreshExceptionMessage() { WatchPanelFacade watchPanelFacade = new WatchPanelFacade(this.DataProvider); object[] exceptionList = watchPanelFacade.QueryExceptionList(this.BigLine, this.NowDBDate); if (exceptionList != null && exceptionList.Length > 0) { string exceptionMessageList = string.Empty; string cuerrtExecptionMessage = string.Empty; this.userControlExceptionMessage.ClearMessage(); int showNumber = 1; foreach (ExceptionEventWithDescription obj in exceptionList) { cuerrtExecptionMessage = obj.ItemCode + "-" + obj.Description + "-" + obj.Memo + "(" + FormatHelper.ToTimeString(obj.BeginTime, ":") + "-" + FormatHelper.ToTimeString(obj.EndTime, ":") + ")" + "\r\n"; exceptionMessageList += showNumber.ToString() + ": " + cuerrtExecptionMessage; showNumber += 1; } this.userControlExceptionMessage.ExpectionMessage = exceptionMessageList; this.userControlExceptionMessage.Refresh(); } }