| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_2114.cs
- * 2.功能描述:恢复数据
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2015/06/13 1.00 新建
- *******************************************************************************/
- using System;
- using System.Data;
- using System.Reflection;
- using System.Text;
- 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
- {
- public partial class F_PM_2114 : DKFormBase
- {
- #region 成员变量
- private string _currentbarcode = "";//当前产品条码
- #endregion
- #region 构造函数
- public F_PM_2114()
- {
- InitializeComponent();
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.Text = "恢复数据";
- }
- #endregion
- #region 事件
- /// <summary>
- /// 保存按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.txtBarCode.Text.Trim() == "")
- {
- MessageBox.Show("产品条码不能为空", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtBarCode.Focus();
- return;
- }
- int returnValue = (int)DoAsync(new BaseAsyncMethod(() =>
- {
- return PMModuleProxy.Service.ResetBarCode(this.txtBarCode.Text.Trim());
- }));
- if (returnValue == -1)
- {
- MessageBox.Show("此条码没有清除,不能恢复", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtBarCode.Focus();
- this.txtBarCode.SelectAll();
- return;
- }
- else if (returnValue == 0)
- {
- MessageBox.Show("没有可恢复的数据", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtBarCode.Focus();
- this.txtBarCode.SelectAll();
- return;
- }
- else if (returnValue > 0)
- {
- MessageBox.Show("恢复数据成功", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtBarCode.Text = "";//成功后,直接下一个
- this.DialogResult = DialogResult.OK;
- return;
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- #endregion
- }
- }
|