private void ExecuteWaitingCommand_Thread() { CardBll cb = new CardBll(AppSettings.CurrentSetting.ParkConnect); WaitingCommandBLL wb = new WaitingCommandBLL(AppSettings.CurrentSetting.ParkConnect); while (true) { List <WaitingCommandInfo> wcs = wb.GetCommands(this.ParkID).QueryObjects; foreach (var wc in wcs) { CardInfo card = cb.GetCardByID(wc.CardID).QueryObject; if (card != null) { if (SaveCard(card, ActionType.Upate)) { wb.Delete(wc); } } else { wb.Delete(wc); } } Thread.Sleep(60000); } }
private void ItemSearching_Handler(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; WaitingCommandSearchCondition con = new WaitingCommandSearchCondition(); con.EntranceID = this.comEntrances.SelectedEntranceID; con.CommandType = this.comCommandType.SelectedCommandType; con.CardID = this.txtCardID.Text.Trim(); con.Status = this.comWaitingCommandStatus.SelectedStatus; WaitingCommandBLL bll = new WaitingCommandBLL(AppSettings.CurrentSetting.ParkConnect); List <WaitingCommandInfo> items = bll.GetCommands(con).QueryObjects; ShowReportsOnGrid(items); this.Cursor = Cursors.Arrow; }