private void mnu_SyncCardToStandby_Click(object sender, EventArgs e) { if (MessageBox.Show(Resource1.FrmSyncDataToStandby_Cover, Resource1.Form_Alert, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } this.Cursor = Cursors.WaitCursor; List <CardInfo> downloadItems = this.cardView.GetSelectedCards(); if (downloadItems.Count > 0) { int count = 0; CardBll standbybll = new CardBll(AppSettings.CurrentSetting.CurrentStandbyConnect); foreach (CardInfo item in downloadItems) { if (standbybll.UpdateOrInsert(item).Result == ResultCode.Successful) { count++; } } MessageBox.Show(string.Format(Resource1.FrmCards_SyncCardToStandby, downloadItems.Count.ToString(), count.ToString())); } this.Cursor = Cursors.Arrow; }
private void ItemUpdated_Handler(object sender, ItemUpdatedEventArgs e) { CardInfo info = (CardInfo)e.UpdatedItem; cardView.UpdateCardInfo(info); if (DataBaseConnectionsManager.Current.StandbyConnected) { CardBll standbybll = new CardBll(AppSettings.CurrentSetting.CurrentStandbyConnect); standbybll.UpdateOrInsert(info); } //foreach (ParkingAdapter pad in ParkingAdapterManager.Instance.ParkAdapters) //{ // pad.SaveCard(info, ActionType.Upate); //} }
private void ItemAdded_Handler(object sender, ItemAddedEventArgs e) { CardInfo info = (CardInfo)e.AddedItem; _cards.Add(info); cardView.AddCardInfo(info); FreshStatusBar(); if (DataBaseConnectionsManager.Current.StandbyConnected) { CardBll standbybll = new CardBll(AppSettings.CurrentSetting.CurrentStandbyConnect); standbybll.UpdateOrInsert(info); } foreach (ParkingAdapter pad in ParkingAdapterManager.Instance.ParkAdapters) { pad.SaveCard(info, ActionType.Add); } }