Beispiel #1
0
        /// <summary>
        /// 保存配置到服务器,先保存到本地,再保存到数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnItem_saveServer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                //增加权限验证  20171011
                bool blnHaveRight = ClientPermission.Authorize("SaveAlarmConfigInServer");
                if (!blnHaveRight)
                {
                    Sys.Safety.ClientFramework.View.Message.DevMessageBox.Show(Sys.Safety.ClientFramework.View.Message.DevMessageBox.MessageType.Information, "当前用户无操作权限!");
                    return;
                }

                if (!InvalidGridDataBeforeSave())
                {
                    return;
                }
                //先保存报警配置到本地文件
                if (!ClientAlarmConfig.SaveConfig(iFlag, gridCtrl.DataSource as List <ClientAlarmItems>))
                {
                    Sys.Safety.ClientFramework.View.Message.DevMessageBox.Show(Sys.Safety.ClientFramework.View.Message.DevMessageBox.MessageType.Information, "保存报警设置到服务器失败");
                    return;
                }
                ClientAlarmConfigCache.IsUseAlarmConfig = this.chk_IsUseAlarmCfg.Checked;
                ClientAlarmConfigCache.IsUsePopupAlarm  = this.chkIsUsePopupAlarm.Checked;
                ClientAlarmConfig.SaveOtherAlarmSwitch();

                ClientAlarmConfig.LoadConfigToCache();

                //再保存到服务器数据库
                bool b = ClientAlarmConfig.SaveConfigToServer();
                //性质、种类、测点发生改变时
                bIsChangeType  = false;
                bIsChangeAlarm = false;
                if (b)
                {
                    Sys.Safety.ClientFramework.View.Message.DevMessageBox.Show(Sys.Safety.ClientFramework.View.Message.DevMessageBox.MessageType.Information, "保存报警设置到服务器成功");
                }
                else
                {
                    Sys.Safety.ClientFramework.View.Message.DevMessageBox.Show(Sys.Safety.ClientFramework.View.Message.DevMessageBox.MessageType.Information, "保存报警设置到服务器失败");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
Beispiel #2
0
        private void LookupLoadData()
        {
            try
            {
                this.repositoryItemCheckedComboBoxEdit1.DataSource = GetAlarmShow();
                this.lookUpEditDefProperty.Properties.DataSource   = ClientAlarmServer.GetListEnumProperty();

                ClientAlarmConfig.LoadConfigToCache();

                this.chk_IsUseAlarmCfg.Checked  = ClientAlarmConfigCache.IsUseAlarmConfig;
                this.chkIsUsePopupAlarm.Checked = ClientAlarmConfigCache.IsUsePopupAlarm;

                this.lookUpEditDefProperty.ItemIndex = 0;
            }
            catch (Exception ex)
            {
                LogHelper.Error("加载设备性质发生异常 " + ex.Message);
            }
        }