private void btnBlock_Click(object sender, EventArgs e) { var latticeInfo = slaveInfoService.GetLatticeInfo(LatticeNo); upDownService.BlockError(new UpDownMessage { LatticeByUpDown = new List <LatticeByUpDown>() { new LatticeByUpDown() { LatticeNo = LatticeNo } } }); buttonService.UpdateButton(latticeInfo); this.Close(); }
private void CommandHandle(UpDownMessage upDownMessage) { //用反射可以一劳永益以后不用再一个一个添加,但影响效率的效率有多少? switch (upDownMessage.UpDownCommand) { case UpDownCommand.PutIng: UpDownService.PutIng(upDownMessage); break; case UpDownCommand.BlockError: UpDownService.BlockError(upDownMessage); break; case UpDownCommand.RemoveBlockError: UpDownService.RemoveBlockError(upDownMessage); break; case UpDownCommand.PrintSingle: UpDownService.PrintSingle(upDownMessage); break; case UpDownCommand.PrintAll: UpDownService.PrintAll(upDownMessage); break; case UpDownCommand.WaveCancel: UpDownService.WaveCancel(upDownMessage); break; case UpDownCommand.WavePowerComplete: UpDownService.WavePowerComplete(upDownMessage); break; default: break; } }