private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { Jc_MacInfo temp = new Jc_MacInfo(); Jc_MacInfo _COM; temp.MAC = this.CcmbSerialPortNum.Text; temp.Type = 1; temp.Bz1 = CcmbBaudRate.Text; temp.Bz2 = CcmbCommPAL.Text; temp.Bz3 = CcmbDatabit.Text; temp.Bz4 = CcmbCheckbit.Text; temp.Bz5 = CcmbStopbit.Text; if (string.IsNullOrEmpty(_COMCode)) { temp.ID = IdHelper.CreateLongId().ToString(); temp.InfoState = InfoState.AddNew; try { Model.MACServiceModel.AddMACCache(temp); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } OperateLogHelper.InsertOperateLog(11, CONFIGServiceModel.AddMacLogs(temp), "");// 20170111 } else { _COM = Model.MACServiceModel.QueryMACByCode(_COMCode); if (_COM != null) { if (_COM != temp) { temp.ID = _COM.ID; temp.InfoState = InfoState.Modified; try { Model.MACServiceModel.UpdateMACCache(temp); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } OperateLogHelper.InsertOperateLog(11, CONFIGServiceModel.UpdateMacLogs(_COM, temp), "");// 20170111 } } } this.Close(); } catch (Exception ex) { LogHelper.Error(ex); } }
private void DefineFrame_FormClosing(object sender, FormClosingEventArgs e) { try { CONFIGServiceModel.SaveRouting(); } catch (Exception ex) { LogHelper.Error(ex); } }
private void barButtonSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { CONFIGServiceModel.SaveRouting(); XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { LogHelper.Error(ex); } //ClbTip.Text = "保存成功"; }
/// <summary> 保存巡检 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cbSave_Click(object sender, EventArgs e) { try { CONFIGServiceModel.SaveRouting(); XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { LogHelper.Error(ex); } ClbTip.Text = "保存成功"; }
/// <summary> /// 加载设备的默认信息函数 /// </summary> public override void LoadPretermitInf() { CtxbCheckCycle.Text = "0"; IList <Jc_DevInfo> temp = Model.DEVServiceModel.QueryDevByDevpropertIDCache(1); for (int i = 0; i < temp.Count; i++) { if (null == temp[i].Xs1) { continue; } if (!this.CcmbUint.Properties.Items.Contains(temp[i].Xs1)) { this.CcmbUint.Properties.Items.Add(temp[i].Xs1); } } if (this.CcmbUint.Properties.Items.Count > 0) { this.CcmbUint.SelectedIndex = 0; } CtxbLowRange.Text = "0"; CtxbMidRange.Text = "0"; CtxbHiRange.Text = "0"; CtxbLowHZ.Text = "200"; CtxbMidHZ.Text = "0"; CtxbHiHZ.Text = "1000"; CtxbHiPreAlarm.Text = "0"; CtxbHiAlarm.Text = "0"; CtxbHiPowerOff.Text = "0"; CtxbHiPowerBack.Text = "0"; CtxbLowPreAlarm.Text = "0"; CtxbLowAlarm.Text = "0"; CtxbLowPowerOff.Text = "0"; CtxbLowPowerBack.Text = "0"; CorrectionCoefficient.Value = 0; //判断是否显示修正系数 20180113 SettingInfo settingInfo = CONFIGServiceModel.GetConfigFKey("IsCorrectionCoefficient"); string isCorrectionCoefficient = "0"; if (settingInfo != null) { isCorrectionCoefficient = settingInfo.StrValue; } if (isCorrectionCoefficient == "1") { layoutControlItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; layoutControlItem5.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; layoutControlItem7.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; layoutControlItem9.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; layoutControlItem17.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; } else { layoutControlItem4.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; layoutControlItem5.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; layoutControlItem7.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; layoutControlItem9.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; layoutControlItem17.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; } }