/// <summary> /// 改变闸机运行模式 /// </summary> /// <param name="modeStr">模式字符串</param> /// <param name="mode">运行模式</param> public void changeGateMode(string modeStr, int mode) { int[] gateIds = getSelectedGates(); if (gateIds == null) { return; } if (MessageBox.Show("你确定要改变选中闸机的运行模式到" + modeStr + "模式?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } ModeStateSetService service = ModeStateSetService.getInstance(); try { service.updateGateMode(mode, gateIds); MessageBox.Show("修改闸机运行模式成功!"); LogService.getInstance().log(gateIds.ToString() + "运行模式变为" + modeStr, ModuleConstant.GateMode_MODULE); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误"); } }
/// <summary> /// 改变闸机状态 /// </summary> /// <param name="modeStr">状态字符串</param> /// <param name="mode">状态</param> public void changeGateState(string stateStr, int state) { int[] gateIds = getSelectedGates(); if (gateIds == null) { return; } if (MessageBox.Show("你确定要改变选中闸机进行" + stateStr + "操作?", "提示", MessageBoxButtons.YesNo) == DialogResult.No) { return; } ModeStateSetService service = ModeStateSetService.getInstance(); try { service.updateGateState(state, gateIds); LogService.getInstance().log(gateIds.ToString() + "闸机状态变为" + stateStr, ModuleConstant.ModeStateSet_MODULE); MessageBox.Show("操作闸机状态成功!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误"); } }