/// <summary> /// 邮件处理逻辑 /// </summary> /// <param name="ope"></param> /// <param name="manual"></param> private void OperationHandler(OperationAction ope, ManualOperation manual) { if (this.textBoxID.Text.Trim() == string.Empty) { return; } this.timerNext.Stop(); needUpdate = true; //发送处理结果给PLC wrapper.ClientSend(this.textBoxID.Text, ope); //实时将处理数据更新到数据库中 ExecNonQuery(ope, manual); //图像清除 this.pictureBoxPic.Image = null; //旋转按钮隐藏 this.buttonRotateLeft.Visible = false; this.buttonRotateRight.Visible = false; //UI 邮件信息清空 this.textBoxID.Text = string.Empty; this.textBoxVolume.Text = string.Empty; this.textBoxWeight.Text = string.Empty; this.textBoxBar.Text = string.Empty; }
private void ExecNonQuery(OperationAction ope, ManualOperation manual) { sqlHandler.ExecNonQuery(string.Format(SqlHelper.InsertStr, ValueHelper.LeftMailID(this.textBoxID.Text == string.Empty ? "0" : this.textBoxID.Text), this.textBoxBar.Text == string.Empty ? "000000000000" : this.textBoxBar.Text, (Byte)ope, DateTime.Now.ToString(), this.textBoxVolume.Text == string.Empty ? "0" : this.textBoxVolume.Text, this.textBoxWeight.Text == string.Empty ? "0" : this.textBoxWeight.Text, (Byte)manual) ); }