void RefreshInfo() { this.txtWindow.Text = windowName; this.lblWindow.Text = windowNo; this.txtUserCode.Text = userId; stateModel = csBll.GetModelByWindowNo(windowNo); if (stateModel != null) { this.txtTicket.Text = stateModel.workState == (int)WorkState.Call ? stateModel.ticketNo : ""; this.txtHangCount.Text = (stateModel.hangId > 0 ? 1 : 0).ToString(); } else { this.txtHangCount.Text = "0"; this.txtTicket.Text = ""; } //查询当前窗口排队等候人数 var list = qBll.GetModelList(windowBusys, 0).OrderBy(o => o.ticketTime).ToList(); //排队中 var list2 = qBll.GetModelList(windowBusys, 1); //已完成 this.txtQueueCount.Text = (list.Count + list2.Count).ToString(); this.txtWait.Text = list.Count.ToString(); this.txtAlready.Text = list2.Count.ToString(); foreach (var l in list.OrderByDescending(o => o.ticketTime).ToList()) { if (qList.FirstOrDefault(q => q.ID == l.ID) == null) { frmMsg frm = new frmMsg(); frm.Ticket = l.qNumber; frm.Show(); break; } } qList = list; //if (x > 3) //{ // frmMsg frm = new frmMsg(); // frm.Ticket = "AB016"; // frm.Show(); // x = 0; //} //x++; //listView2.Items.Clear(); //foreach (var item in list) //{ // ListViewItem lvItem = new ListViewItem(); // lvItem.Tag = item; // lvItem.SubItems[0].Text = item.ticketNumber; // lvItem.SubItems.Add(item.ticketTime.ToString("yyyy-MM-dd HH:mm:ss")); // lvItem.SubItems.Add(item.qNmae); // listView2.Items.Add(lvItem); //} //listView2.Refresh(); }
void RefreshInfo() { try { this.txtWindow.Text = windowName; this.lblWindow.Text = windowNo; this.txtUserCode.Text = userId; stateModel = csBll.GetModelByWindowNo(windowNo); if (stateModel != null) { this.txtTicket.Text = stateModel.workState == (int)WorkState.Call ? stateModel.ticketNo : ""; this.txtHangCount.Text = (stateModel.hangId > 0 ? 1 : 0).ToString(); } else { this.txtHangCount.Text = "0"; this.txtTicket.Text = ""; } //查询当前窗口排队等候人数 var list = qBll.GetModelList(windowBusys, 0).OrderBy(o => o.ticketTime).ToList(); //排队中 var list2 = qBll.GetModelList(windowBusys, 1); //已完成 this.txtQueueCount.Text = (list.Count + list2.Count).ToString(); this.txtWait.Text = list.Count.ToString(); this.txtAlready.Text = list2.Count.ToString(); foreach (var l in list.OrderByDescending(o => o.ticketTime).ToList()) { if (qList.FirstOrDefault(q => q.ID == l.ID) == null) { frmMsg frm = new frmMsg(); frm.Ticket = l.qNumber; frm.Show(); break; } } qList = list; } catch (Exception ex) { File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "log\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\Exception.txt", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " : " + ex.Message + "\r\n"); this.messageIndicator1.SetState(StateType.Error, "数据刷新异常,请核查网络!"); } }