From 25337572137ca1032dc3f8b15efab66de13235f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE=E7=94=B7?= <446507344@qq.com> Date: Mon, 15 May 2023 08:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=A3=B0=E9=9F=B3=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Forms/Operation/OperationForm.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs b/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs index 39e45ce..5933823 100644 --- a/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs +++ b/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs @@ -638,7 +638,8 @@ namespace QMAPP.WinForm.Forms.Operation if (comMachine.Items.Count <= 0) { txtCode.Text = ""; - PlaySound.PlaySounds.Play(@errorSoundPath); + //PlaySound.PlaySounds.Play(@errorSoundPath); + System.Media.SoundPlayer media = new System.Media.SoundPlayer(errorSoundPath); this.lblError.Text = "请先选择设备!"; this.lblError.ForeColor = Color.White; this.lblError.BackColor = Color.Red; @@ -651,7 +652,8 @@ namespace QMAPP.WinForm.Forms.Operation if (string.IsNullOrEmpty(productCode)) { txtCode.Text = ""; - PlaySound.PlaySounds.Play(@errorSoundPath); + //PlaySound.PlaySounds.Play(@errorSoundPath); + System.Media.SoundPlayer media = new System.Media.SoundPlayer(errorSoundPath); this.lblError.Text = "请输入条码!"; this.lblError.ForeColor = Color.White; this.lblError.BackColor = Color.Red; @@ -671,7 +673,8 @@ namespace QMAPP.WinForm.Forms.Operation if (dai == null) { txtCode.Text = ""; - PlaySound.PlaySounds.Play(@errorSoundPath); + //PlaySound.PlaySounds.Play(@errorSoundPath); + System.Media.SoundPlayer media = new System.Media.SoundPlayer(errorSoundPath); this.lblError.Text = "输入条码不是本工序可接受格式!"; this.lblError.ForeColor = Color.White; this.lblError.BackColor = Color.Red; @@ -759,7 +762,8 @@ namespace QMAPP.WinForm.Forms.Operation if (!result.Success) //如果采集数据输入失败 { - PlaySound.PlaySounds.Play(@errorSoundPath); + //PlaySound.PlaySounds.Play(@errorSoundPath); + System.Media.SoundPlayer media = new System.Media.SoundPlayer(errorSoundPath); this.lblError.Text = result.Message; this.lblError.ForeColor = Color.White; this.lblError.BackColor = Color.Red; @@ -795,7 +799,12 @@ namespace QMAPP.WinForm.Forms.Operation this.txtCode.Text = ""; - PlaySound.PlaySounds.Play(@okSoundPath); + //PlaySound.PlaySounds.Play(@okSoundPath); + if (!"770,018,278".Contains(productCode.Substring(0, 3))) + { + System.Media.SoundPlayer media = new System.Media.SoundPlayer(@okSoundPath); + } + if (this.lblLock.Tag.ToString().Equals("0")) {