public BoardUc(IBiModel model, IDatabaseService dataService) { InitializeComponent(); _model = model; _posMapScheme = BiModelFactory.CreateIPosMapScheme(dataService); _boardRowNumber = _posMapScheme.GetDefaultPosMapBlock().BoardRows; _boardColNumber = _posMapScheme.GetDefaultPosMapBlock().BoardCols; _model.BoardStateChanged += (s, e) => { _redraw = true; }; var redrawTimer = new Timer() { Interval = 500 }; redrawTimer.Tick += (s, e) => { try { redrawTimer.Stop(); if (_redraw == true) { this.BeginInvoke(new Action(Refresh)); } } finally { _redraw = false; redrawTimer.Start(); } }; redrawTimer.Start(); }
public ProductUc(IBiModel model, IDatabaseService dataService) { InitializeComponent(); var posMapBlock = BiModelFactory.CreateIPosMapScheme(dataService).GetDefaultPosMapBlock(); _seatRows = posMapBlock.SeatRows; _seatCols = posMapBlock.SeatCols; _productpositioncount = _seatRows * _seatCols; _model = model; _model.ProductsUpdate += (s, e) => { redraw = true; }; redrawTimer = new Timer() { Interval = 500 }; redrawTimer.Tick += (s, e) => { try { redrawTimer.Stop(); if (redraw == true) { this.BeginInvoke(new Action(Refresh)); } } finally { redraw = false; redrawTimer.Start(); } }; redrawTimer.Start(); }
private void InitUi() { var posMapBlock = BiModelFactory.CreateIPosMapScheme(_dataService).GetDefaultPosMapBlock(); tableLayoutPanel1.RowStyles[1].Height = posMapBlock.BoardRows / (float)(posMapBlock.BoardRows + posMapBlock.SeatRows); tableLayoutPanel1.RowStyles[2].Height = posMapBlock.SeatRows / (float)(posMapBlock.BoardRows + posMapBlock.SeatRows); _ups = UPSUtility.Instance(_logger, _configInfo); _model = BiModelFactory.GetBiModel(_logger, _dataService, GetModelParam(_configInfo)); parameterShowUC.SetModel(_model); AddBoardUc(); AddProductUc(); boarduc.ActiveBoardEvent += productuc.OnBoardActive; productuc.NotifyActiveSn += OnNotifyActiveSn; }
public SNBindingDialog(string boardname, IBiModel model, ConfigInfo param) { InitializeComponent(); lbBoardName.Text = boardname; _model = model; int seatCount = _model.GetBoardSeatsCount(boardname); _configParam = param; snlist = new string[seatCount]; for (int i = 0; i < seatCount; i++) { snlist[i] = ""; } InitTable(seatCount); _board = _model.GetController(boardname); _MesOperator = BiModelFactory.GetMesOperator(); }
public void SetModel(IBiModel model) { this.model = model; }