private void Init() { _selectedData = new TL_NOTIFY(); _dataList = NotifyController.GetNewList(_db, GlobalVar.NotifytypeList); bs.DataSource = _dataList; grid.PrimaryGrid.DataSource = bs; bn.BindingSource = bs; grid.PrimaryGrid.ReadOnly = true; }
public static bool GetNotifyList(SpareEntities db) { var list = NotifyController.GetNewList(db); if (NotifyList != null || list.Count(p => p.State == (int)BillState.New) != 0) { NotifyList = new SortableBindingList <TL_NOTIFY>(list); return(true); } return(false); }
private void ShowNotifyAlertWindow() { using (SpareEntities db = EntitiesFactory.CreateSpareInstance()) { var list = NotifyController.GetNewList(db, GlobalVar.NotifytypeList); if (list.Count == 0) { return; } list = list.Where(p => p.State == (int)BillState.New).ToList(); if (list.Count == 0) { return; } lblNotify.Text = $"待处理提示数量:{list.Count}"; lblNotify.Visible = true; try { var alertWindow = new DesktopAlertWindow { CloseButtonVisible = true, AlertPosition = eAlertPosition.BottomRight, BackColor = Color.DarkOrange, ForeColor = Color.White, Symbol = "\uf005", SymbolColor = Color.White, AutoCloseTimeOut = 60, Text = $"您有 {list.Count} 个待处理的提示信息,点击查看...", AlertId = 0 }; alertWindow.Click += AlertWindow_Click; alertWindow.Show(); } catch (Exception ex) { MessageHelper.ShowError(ex); } } }