| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_3102.cs
- * 2.功能描述:品保抽查操作页面
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2019/05/10 1.00 新建
- *******************************************************************************/
- using System;
- using System.Data;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.Controls;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- namespace Dongke.IBOSS.PRD.Client.PMModule
- {
- /// <summary>
- /// 品保抽查操作页面
- /// </summary>
- public partial class F_PM_3102 : DKFormBase
- {
- #region 成员变量
- private const string F_INFO = "产品编码:{0}\r\n\r\n注浆日期:{1:yyyy-MM-dd}\r\n\r\n模具编号:{2}\r\n\r\n成型工号:{3}\r\n\r\n当前工序:{4}";
- #endregion
- #region 构造函数
- /// <summary>
- /// 品保抽查操作页面
- /// </summary>
- public F_PM_3102()
- {
- InitializeComponent();
- // 控件赋值
- this.Text = "品保抽查";
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.btnCancel.Text = ButtonText.BTN_CANCEL;
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_3102_Load(object sender, EventArgs e)
- {
- try
- {
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 条码按键事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void txtBarCode_KeyPress(object sender, KeyPressEventArgs e)
- {
- try
- {
- if ((int)e.KeyChar == 13) // 按了回车键
- {
- //this.btnSave.Visible = false;
- string barCode = this.txtBarCode.Text.Trim();
- if (string.IsNullOrEmpty(barCode))
- {
- MessageBox.Show("产品条码不能为空", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtBarCode.Focus();
- return;
- }
- // 异步处理,验证挂起条码
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "QASpotCheck";
- cre.Name = "CheckQASpotCheck";
- cre.Request = barCode;
- // 调用服务器端获取数据集
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
- {
- return PMModuleProxyNew.Service.HandleRequest(cre);
- }));
- if (sre.Data != null && sre.Data.Tables[0].Rows.Count > 0)
- {
- DataRow dataRow = sre.Data.Tables[0].Rows[0];
- this.txtInfo.Text = string.Format(F_INFO,
- dataRow["goodscode"],
- dataRow["groutingdate"],
- dataRow["groutingmouldcode"],
- dataRow["usercode"],
- dataRow["procedurename"]);
- this.txtInfo.Tag = dataRow;
- this.btnSave.Visible = true;
- this.txtRemarks.Focus();
- }
- else
- {
- this.txtInfo.Text = null;
- this.txtInfo.Tag = null;
- MessageBox.Show(sre.Message, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtBarCode.SelectAll();
- return;
- }
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 保存按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- DataRow dataRow = this.txtInfo.Tag as DataRow;
- if (dataRow == null)
- {
- return;
- }
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "QASpotCheck";
- cre.Name = "SaveQASpotCheck";
- cre.Properties["GroutingDailyDetailID"] = dataRow["GroutingDailyDetailID"];
- cre.Properties["Remarks"] = this.txtRemarks.Text.Trim();
- cre.Properties["ProcedureID"] = dataRow["ProcedureID"];
- cre.Properties["ProcedureName"] = dataRow["ProcedureName"];
- cre.Properties["CheckTime"] = dataRow["CheckTime"];
- // 异步处理
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
- {
- return PMModuleProxyNew.Service.HandleRequest(cre);
- }));
- if (Convert.ToInt32(sre.Result) < 0)
- {
- MessageBox.Show(sre.Message,
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- else
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, this.Text, "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.btnSave.Visible = false;
- this.Close();
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 关闭按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #endregion
- }
- }
|