private bool Sync_KeySetting() { bool success = true; List <EntranceInfo> entrances = this.hardwareTree1.GetSelectedEntrances(); foreach (EntranceInfo entrance in entrances) { IParkingAdapter pad = ParkingAdapterManager.Instance[entrance.RootParkID]; bool ret = false; if (pad != null) { NotifyMessage(string.Format(Resources.Resource1.FrmDownLoadKeySetting_Download, entrance.EntranceName)); ret = pad.DownloadKeySettingToEntrance(entrance.EntranceID, KeySetting.Current); if (!ret) { WaitingCommandBLL wcBll = new WaitingCommandBLL(AppSettings.CurrentSetting.CurrentMasterConnect); WaitingCommandInfo wcInfo = new WaitingCommandInfo(); wcInfo.EntranceID = entrance.EntranceID; wcInfo.Command = BusinessModel.Enum.CommandType.DownloadKeySetting; wcBll.DeleteAndInsert(wcInfo); } } success = ret ? success : false; NotifyHardwareTreeEntrance(entrance.EntranceID, ret); } return(success); }
private bool Sync_KeySetting() { bool success = true; List <EntranceInfo> entrances = this.hardwareTree1.GetSelectedEntrances(); foreach (EntranceInfo entrance in entrances) { IParkingAdapter pad = ParkingAdapterManager.Instance[entrance.RootParkID]; bool ret = false; if (pad != null) { NotifyMessage(string.Format(Resources.Resource1.FrmDownLoadKeySetting_Download, entrance.EntranceName)); ret = pad.DownloadKeySettingToEntrance(entrance.EntranceID, KeySetting.Current); } success = ret ? success : false; NotifyHardwareTreeEntrance(entrance.EntranceID, ret); } return(success); }
public bool DownloadKeySettingToEntrance(int entranceID, KeySetting keySetting) { try { if (_Channel != null) { return(_Channel.DownloadKeySettingToEntrance(entranceID, keySetting)); } } catch (CommunicationException) { if (ParkAdapterConnectFail != null) { ParkAdapterConnectFail(this, EventArgs.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } return(false); }