| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- /*******************************************************************************
- * Copyright(c) 2012 dongke All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:S_CMN_020.cs
- * 2.功能描述:记录漏扫成型工信息
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2015/05/11 1.00 新建
- *******************************************************************************/
- using System;
- using System.ComponentModel;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Basics.Library;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- namespace Dongke.IBOSS.PRD.Client.Controls.FormCommon
- {
- /// <summary>
- /// 记录漏扫成型工信息
- /// </summary>
- public partial class S_CMN_020 : FormBase
- {
- #region 成员变量
- private int _missid = 0; //漏扫表ID
- #endregion
- #region 构造函数
- public S_CMN_020()
- {
- InitializeComponent();
- this.Text = FormTitles.S_CMN_020;
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- public S_CMN_020(int missid, string errorMessage)
- {
- InitializeComponent();
- this._missid = missid;
- this.txtErrorMessage.Text = errorMessage;
- this.Text = FormTitles.S_CMN_020;
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- public S_CMN_020(int missid, string errorMessage,string groutingusercode)
- {
- InitializeComponent();
- this._missid = missid;
- this.txtErrorMessage.Text = errorMessage;
- this.txtGroutingusercode.Text = groutingusercode;
- this.Text = FormTitles.S_CMN_020;
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 事件
- /// <summary>
- /// 确定按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- // 验证输入是否正确
- if (!this.CheckInputValidity())
- {
- return;
- }
- int returnRow = (int)DoAsync(new BaseAsyncMethod(() =>
- {
- return PMModuleProxy.Service.UpdateGroutingUserCodeByMissingID(this.txtGroutingusercode.Text.Trim(), this._missid);
- }));
- // 提示信息
- if (returnRow == -1)
- {
- // 提示信息
- MessageBox.Show("存在无效的漏扫工号",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtGroutingusercode.SelectAll();
- return;
- }
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "新增" + this.Text, "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.Close();
- }
- catch (Exception ex)
- {
- this.btnSave.Enabled = true;
- this.btnClose.Enabled = true;
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 验证输入格式是否正确
- /// </summary>
- /// <returns></returns>
- private bool CheckInputValidity()
- {
- if (string.IsNullOrEmpty(this.txtGroutingusercode.Text.Trim()))
- {
- this.txtGroutingusercode.IsMustInput = true;
- this.txtGroutingusercode.Focus();
- return false;
- }
- return true;
- }
- #endregion
- }
- }
|