| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_0603.cs
- * 2.功能描述:撤销入窑
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2015/05/12 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.Basics.Library;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
- namespace Dongke.IBOSS.PRD.Client.PMModule
- {
- public partial class F_PM_0603 : FormBase
- {
- #region 成员变量
- // 配置文件的全路径
- private string _iniFilePath = LocalPath.RootPath + Constant.INI_FILE_NAME;
- // 工序ID
- private int _procedureID;
- //窑车实体类
- CheckKilnCarResultEntity _kilnCarEntity = null;
- #endregion
- #region 构造函数
- public F_PM_0603()
- {
- InitializeComponent();
- this.btnClose.Text = ButtonText.BTN_SAVE;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- public F_PM_0603(int procedureID)
- {
- InitializeComponent();
- this._procedureID = procedureID;
- this.btnClose.Text = ButtonText.BTN_SAVE;
- this.btnClose.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_0603_Load(object sender, EventArgs e)
- {
- try
- {
- //string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
- // Constant.INI_KEY_KILN_CODE, this._iniFilePath);
- string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
- Constant.INI_KEY_KILN_CODE, LocalPath.LocalINIFilePath);
- if (getKiln != string.Empty)
- {
- this.txtKiln.Text = getKiln;
- this.txtKilnCarCode.Focus();
- }
- else
- {
- this.txtKiln.Focus();
- }
- }
- 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 txtKiln_Validating(object sender, System.ComponentModel.CancelEventArgs e)
- {
- try
- {
- if (this.txtKiln.Text.Trim() == string.Empty)
- {
- this._kilnCarEntity = null;
- return;
- }
- if (this.txtKiln.Text.Trim() != "")
- {
- if (!this.txtKiln.ReadOnly)
- {
- DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
- {
- return SystemModuleProxy.Service.GetAllKilntInfo();
- }));
- if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
- {
- DataView dv = dsResultAccount.Tables[0].DefaultView;
- dv.RowFilter = "ValueFlag=1 and KilnCode='" + this.txtKiln.Text.Trim() + "'";
- DataTable dt = dv.ToTable();
- if (dt.Rows.Count == 0)
- {
- // 提示信息
- MessageBox.Show("不存在此窑炉编号",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtKiln.SelectAll();
- this.txtKiln.Focus();
- return;
- }
- // 保存业务系统配置
- Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
- this.txtKiln.Text.Trim(), this._iniFilePath);
- }
- }
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- #endregion
- /// <summary>
- /// 保存按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- if (txtKiln.Text.Trim() == "")
- {
- txtKiln.Focus();
- return;
- }
- if (txtKilnCarCode.Text.Trim() == "")
- {
- txtKilnCarCode.Focus();
- return;
- }
- int returnRow = (int)DoAsync(new BaseAsyncMethod(() =>
- {
- return PMModuleProxy.Service.CheckKilnCarByIntoCar2(this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim(), this._procedureID);
- }));
- if (returnRow == -99)
- {
- MessageBox.Show("窑炉车号无效",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtKilnCarCode.Focus();
- return;
- }
- if (returnRow == -98)
- {
- MessageBox.Show("窑车己无产品",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtKilnCarCode.Focus();
- return;
- }
- if (returnRow == -97)
- {
- MessageBox.Show("窑车没有入窑,不可以撤销",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtKilnCarCode.Focus();
- return;
- }
- if (returnRow == -1)
- {
- MessageBox.Show("保存失败",
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.txtKilnCarCode.Focus();
- return;
- }
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "新增" + this.Text, "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.Close();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- }
- }
|