|
|
@@ -57,6 +57,7 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
// 是否有商标名称
|
|
|
private string _isLogoName = "";
|
|
|
|
|
|
+ private DataSet _KilntInfo = null;
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
|
@@ -182,20 +183,24 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- //string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
|
|
|
- // Constant.INI_KEY_KILN_CODE, this._iniFilePath);
|
|
|
- string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
|
|
|
+ dtpFiredDate.Value = DateTime.Now.Date;
|
|
|
+ //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);
|
|
|
|
|
|
+ _KilntInfo = SystemModuleProxy.Service.GetAllKilntInfo();
|
|
|
+
|
|
|
if (getKiln != string.Empty)
|
|
|
{
|
|
|
this.txtKiln.Text = getKiln;
|
|
|
if (this.txtKiln.Text.Trim() != "")
|
|
|
{
|
|
|
- DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
|
|
|
- {
|
|
|
- return SystemModuleProxy.Service.GetAllKilntInfo();
|
|
|
- }));
|
|
|
+ //DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
|
|
|
+ //{
|
|
|
+ // return SystemModuleProxy.Service.GetAllKilntInfo();
|
|
|
+ //}));
|
|
|
+ DataSet dsResultAccount = _KilntInfo;
|
|
|
if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
|
|
|
{
|
|
|
DataView dv = dsResultAccount.Tables[0].DefaultView;
|
|
|
@@ -243,10 +248,11 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
this.KilnCarPosition.DataSource = tKilnCarInfo.Copy();
|
|
|
this.dgvProduction.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
|
|
|
// 获取工序明细数据
|
|
|
- ProcedureEntity procedureDataEntity = (ProcedureEntity)DoAsync(new BaseAsyncMethod(() =>
|
|
|
- {
|
|
|
- return PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
|
|
|
- }));
|
|
|
+ //ProcedureEntity procedureDataEntity = (ProcedureEntity)DoAsync(new BaseAsyncMethod(() =>
|
|
|
+ //{
|
|
|
+ // return PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
|
|
|
+ //}));
|
|
|
+ ProcedureEntity procedureDataEntity = PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
|
|
|
this._procedureDataEntity = procedureDataEntity;
|
|
|
// 设置控件禁用或启用
|
|
|
SetControlEnable();
|
|
|
@@ -291,123 +297,6 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 控件数据校验时发生
|
|
|
- /// </summary>
|
|
|
- /// <param name="sender"></param>
|
|
|
- /// <param name="e"></param>
|
|
|
- private void txtUserCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- if (txtUserCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
|
|
|
- {
|
|
|
- this.txtUserCode.IsMustInput = true;
|
|
|
- this.txtUserCode.SelectAll();
|
|
|
- e.Cancel = true;
|
|
|
- return;
|
|
|
- }
|
|
|
- else if (!this.txtUserCode.ReadOnly)
|
|
|
- {
|
|
|
- SUserEntity userEntity = new SUserEntity();
|
|
|
- userEntity.UserCode = this.txtUserCode.Text.Trim();
|
|
|
- // 是否存在此用户编码的生产工号
|
|
|
- CheckProcedureUserResult MsgCheckProcedureUser = (CheckProcedureUserResult)DoAsync(new BaseAsyncMethod(() =>
|
|
|
- {
|
|
|
- return PMModuleProxy.Service.CheckProcedureUser(this._procedureID, this.txtUserCode.Text.Trim());
|
|
|
- }));
|
|
|
- if (MsgCheckProcedureUser != null)
|
|
|
- {
|
|
|
- if (!string.IsNullOrEmpty(MsgCheckProcedureUser.ErrMsg))
|
|
|
- {
|
|
|
- MessageBox.Show(MsgCheckProcedureUser.ErrMsg,
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtUserCode.SelectAll();
|
|
|
- e.Cancel = true;
|
|
|
- return;
|
|
|
- }
|
|
|
- // 有此生产工号
|
|
|
- if (this._productionEntity.UserID != -Constant.INT_IS_ONE)
|
|
|
- {
|
|
|
- if (MsgCheckProcedureUser.UserID != this._productionEntity.UserID)
|
|
|
- {
|
|
|
- this.SaveDataInfo();
|
|
|
- }
|
|
|
- }
|
|
|
- this._productionEntity.UserID = MsgCheckProcedureUser.UserID;
|
|
|
- this._productionEntity.UserCode = MsgCheckProcedureUser.UserCode;
|
|
|
- this._productionEntity.UserName = MsgCheckProcedureUser.UserName;
|
|
|
- this.txtUserCode.ReadOnly = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- 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 txtKilnCarCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- if (this.txtKilnCarCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
|
|
|
- {
|
|
|
- //this.txtKilnCarCode.IsMustInput = true;
|
|
|
- //this.txtKilnCarCode.SelectAll();
|
|
|
- //e.Cancel = true;
|
|
|
- //return;
|
|
|
- }
|
|
|
- else if (!this.txtKilnCarCode.ReadOnly)
|
|
|
- {
|
|
|
- ClientRequestEntity cre = new ClientRequestEntity();
|
|
|
- cre.NameSpace = "F_PM_0504";
|
|
|
- cre.Name = "CheckKilnCar";
|
|
|
- cre.Properties["kilncarcode"]= this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
|
|
|
- cre.Properties["procedureID"] = this._procedureID;
|
|
|
- ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
|
|
|
-
|
|
|
- this._productionEntity.KilnCarID = null;
|
|
|
- this._productionEntity.KilnCarCode = null;
|
|
|
- if (sre == null)
|
|
|
- {
|
|
|
- MessageBox.Show("此窑车不存在",
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtKilnCarCode.SelectAll();
|
|
|
- e.Cancel = true;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (sre.Status == Constant.ServiceResultStatus.Other)
|
|
|
- {
|
|
|
- MessageBox.Show(sre.Message,
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtKilnCarCode.SelectAll();
|
|
|
- e.Cancel = true;
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- this._productionEntity.KilnCarID = Convert.ToInt32(sre.Result);
|
|
|
- this._productionEntity.KilnCarCode = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
|
|
|
-
|
|
|
- //this.txtKilnCarCode.ReadOnly = true;
|
|
|
- //this.txtKiln.ReadOnly = true;
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- // 对异常进行共通处理
|
|
|
- ExceptionManager.HandleEventException(this.ToString(),
|
|
|
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
/// 条形码按键事件
|
|
|
/// </summary>
|
|
|
/// <param name="sender"></param>
|
|
|
@@ -433,24 +322,24 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
|
|
|
if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
|
|
|
{
|
|
|
- if (this.txtUserCode.Text.Trim() == string.Empty)
|
|
|
- {
|
|
|
- this.txtUserCode.Focus();
|
|
|
- this.txtBarcode.Text = string.Empty;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.txtKilnCarCode.Text.Trim() == string.Empty)
|
|
|
- {
|
|
|
- this.txtKilnCarCode.Focus();
|
|
|
- this.txtBarcode.Text = string.Empty;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.txtBarcode.Text.Trim() == string.Empty)
|
|
|
- {
|
|
|
- this.txtBarcode.SelectAll();
|
|
|
- this.txtBarcode.Focus();
|
|
|
- return;
|
|
|
- }
|
|
|
+ //if (this.txtUserCode.Text.Trim() == string.Empty)
|
|
|
+ //{
|
|
|
+ // this.txtUserCode.Focus();
|
|
|
+ // this.txtBarcode.Text = string.Empty;
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ //if (this.txtKilnCarCode.Text.Trim() == string.Empty)
|
|
|
+ //{
|
|
|
+ // this.txtKilnCarCode.Focus();
|
|
|
+ // this.txtBarcode.Text = string.Empty;
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ //if (this.txtBarcode.Text.Trim() == string.Empty)
|
|
|
+ //{
|
|
|
+ // this.txtBarcode.SelectAll();
|
|
|
+ // this.txtBarcode.Focus();
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
DataRow[] drRows = this.DataSourceTable.Select("BarCode='" + this.txtBarcode.Text.Trim() + "'");
|
|
|
if (drRows.Length == Constant.INT_IS_ZERO)
|
|
|
{
|
|
|
@@ -539,7 +428,7 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
//}
|
|
|
//else
|
|
|
//{
|
|
|
- this.CollectTypeOne(procedureDataEntity,dsCheckBarcode); // 集中采集
|
|
|
+ this.CollectTypeOne(procedureDataEntity, dsCheckBarcode); // 集中采集
|
|
|
//}
|
|
|
this.txtBarcode.Text = string.Empty;
|
|
|
this.txtBarcode.Focus();
|
|
|
@@ -561,6 +450,263 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 控件数据校验时发生
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private void txtUserCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (txtUserCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
|
|
|
+ {
|
|
|
+ this.txtUserCode.IsMustInput = true;
|
|
|
+ this.txtUserCode.SelectAll();
|
|
|
+ e.Cancel = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else if (!this.txtUserCode.ReadOnly)
|
|
|
+ {
|
|
|
+ SUserEntity userEntity = new SUserEntity();
|
|
|
+ userEntity.UserCode = this.txtUserCode.Text.Trim();
|
|
|
+ // 是否存在此用户编码的生产工号
|
|
|
+ CheckProcedureUserResult MsgCheckProcedureUser = (CheckProcedureUserResult)DoAsync(new BaseAsyncMethod(() =>
|
|
|
+ {
|
|
|
+ return PMModuleProxy.Service.CheckProcedureUser(this._procedureID, this.txtUserCode.Text.Trim());
|
|
|
+ }));
|
|
|
+ if (MsgCheckProcedureUser != null)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(MsgCheckProcedureUser.ErrMsg))
|
|
|
+ {
|
|
|
+ MessageBox.Show(MsgCheckProcedureUser.ErrMsg,
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ this.txtUserCode.SelectAll();
|
|
|
+ e.Cancel = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 有此生产工号
|
|
|
+ if (this._productionEntity.UserID != -Constant.INT_IS_ONE)
|
|
|
+ {
|
|
|
+ if (MsgCheckProcedureUser.UserID != this._productionEntity.UserID)
|
|
|
+ {
|
|
|
+ this.SaveDataInfo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this._productionEntity.UserID = MsgCheckProcedureUser.UserID;
|
|
|
+ this._productionEntity.UserCode = MsgCheckProcedureUser.UserCode;
|
|
|
+ this._productionEntity.UserName = MsgCheckProcedureUser.UserName;
|
|
|
+ this.txtUserCode.ReadOnly = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ // 对异常进行共通处理
|
|
|
+ ExceptionManager.HandleEventException(this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void txtKiln_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtKiln.Text) ||
|
|
|
+ this.txtKiln.ReadOnly)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
|
|
|
+ //{
|
|
|
+ // return SystemModuleProxy.Service.GetAllKilntInfo();
|
|
|
+ //}));
|
|
|
+ //DataSet dsResultAccount = SystemModuleProxy.Service.GetAllKilntInfo();
|
|
|
+ DataSet dsResultAccount = _KilntInfo;
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ _productionEntity.KilnID = null;
|
|
|
+ _productionEntity.KilnCode = null;
|
|
|
+ e.Cancel = true;
|
|
|
+ this.txtKiln.SelectAll();
|
|
|
+ // 提示信息
|
|
|
+ MessageBox.Show("不存在此窑炉编号",
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _productionEntity.KilnID = Convert.ToInt32(dt.Rows[0]["KilnID"]);
|
|
|
+ _productionEntity.KilnCode = this.txtKiln.Text.Trim();
|
|
|
+ }
|
|
|
+ // 保存业务系统配置
|
|
|
+ Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
|
|
|
+ this.txtKiln.Text.Trim(), this._iniFilePath);
|
|
|
+
|
|
|
+ // 验证烧成批次
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
|
|
|
+ this._productionEntity.KilnID == null ||
|
|
|
+ this._productionEntity.KilnID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
|
|
|
+ this._productionEntity.KilnCarID == null ||
|
|
|
+ this._productionEntity.KilnCarID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.CheckFiredBatchNo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ // 对异常进行共通处理
|
|
|
+ ExceptionManager.HandleEventException(this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void txtKiln_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
|
|
|
+ {
|
|
|
+ this.txtKilnCarCode.Focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ // 对异常进行共通处理
|
|
|
+ ExceptionManager.HandleEventException(this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void txtKilnCarCode_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
|
|
|
+ {
|
|
|
+ this.dtpFiredDate.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 txtKilnCarCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtKilnCarCode.Text) ||
|
|
|
+ this.txtKilnCarCode.ReadOnly)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ClientRequestEntity cre = new ClientRequestEntity();
|
|
|
+ cre.NameSpace = "F_PM_0504";
|
|
|
+ cre.Name = "CheckKilnCar";
|
|
|
+ cre.Properties["kilncarcode"] = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
|
|
|
+ cre.Properties["procedureID"] = this._procedureID;
|
|
|
+ ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
|
|
|
+
|
|
|
+ this._productionEntity.KilnCarID = null;
|
|
|
+ this._productionEntity.KilnCarCode = null;
|
|
|
+ if (sre == null)
|
|
|
+ {
|
|
|
+ this.txtKilnCarCode.SelectAll();
|
|
|
+ e.Cancel = true;
|
|
|
+ MessageBox.Show("此窑车不存在",
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (sre.Status == Constant.ServiceResultStatus.Other)
|
|
|
+ {
|
|
|
+ this.txtKilnCarCode.SelectAll();
|
|
|
+ e.Cancel = true;
|
|
|
+ MessageBox.Show(sre.Message,
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this._productionEntity.KilnCarID = Convert.ToInt32(sre.Result);
|
|
|
+ this._productionEntity.KilnCarCode = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
|
|
|
+
|
|
|
+ //this.txtKilnCarCode.ReadOnly = true;
|
|
|
+ //this.txtKiln.ReadOnly = true;
|
|
|
+
|
|
|
+ // 验证烧成批次
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
|
|
|
+ this._productionEntity.KilnID == null ||
|
|
|
+ this._productionEntity.KilnID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
|
|
|
+ this._productionEntity.KilnCarID == null ||
|
|
|
+ this._productionEntity.KilnCarID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.CheckFiredBatchNo();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ // 对异常进行共通处理
|
|
|
+ ExceptionManager.HandleEventException(this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void dtpFiredDate_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ {
|
|
|
+ // 验证烧成批次
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
|
|
|
+ this._productionEntity.KilnID == null ||
|
|
|
+ this._productionEntity.KilnID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
|
|
|
+ this._productionEntity.KilnCarID == null ||
|
|
|
+ this._productionEntity.KilnCarID == -1)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.CheckFiredBatchNo();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 删除按钮事件
|
|
|
/// </summary>
|
|
|
/// <param name="sender"></param>
|
|
|
@@ -656,10 +802,10 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
/// <param name="e"></param>
|
|
|
private void txtUserCode_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
{
|
|
|
- if ((int)e.KeyChar == 13) // 按了回车键
|
|
|
- {
|
|
|
- this.txtKilnCarCode.Focus();
|
|
|
- }
|
|
|
+ //if ((int)e.KeyChar == 13) // 按了回车键
|
|
|
+ //{
|
|
|
+ // this.txtKilnCarCode.Focus();
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
@@ -961,50 +1107,39 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- private void txtKiln_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
+ private void btnOk_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
+ this.btnOk.Focus();
|
|
|
+ if (this.txtFiredBatchNo.ReadOnly)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
try
|
|
|
{
|
|
|
- if (this.txtKiln.Text.Trim() == string.Empty)
|
|
|
+ btnOk.Tag = 1;
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
|
|
|
+ this._productionEntity.KilnID == null ||
|
|
|
+ this._productionEntity.KilnID == -1)
|
|
|
{
|
|
|
+ MessageBox.Show("没有输入窑炉", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ this.txtKiln.Focus();
|
|
|
return;
|
|
|
}
|
|
|
- if (this.txtKiln.Text.Trim() != "")
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
|
|
|
+ this._productionEntity.KilnCarID == null ||
|
|
|
+ this._productionEntity.KilnCarID == -1)
|
|
|
{
|
|
|
- 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)
|
|
|
- {
|
|
|
- _productionEntity.KilnID = null;
|
|
|
- _productionEntity.KilnCode = null;
|
|
|
- // 提示信息
|
|
|
- MessageBox.Show("不存在此窑炉编号",
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtKiln.SelectAll();
|
|
|
- this.txtKiln.Focus();
|
|
|
- return;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _productionEntity.KilnID = Convert.ToInt32(dt.Rows[0]["KilnID"]);
|
|
|
- _productionEntity.KilnCode = this.txtKiln.Text.Trim();
|
|
|
- }
|
|
|
- // 保存业务系统配置
|
|
|
- Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
|
|
|
- this.txtKiln.Text.Trim(), this._iniFilePath);
|
|
|
- }
|
|
|
- }
|
|
|
+ MessageBox.Show("没有输入窑车", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ this.txtKilnCarCode.Focus();
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
+ {
|
|
|
+ MessageBox.Show("没有输入烧成批次", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ this.txtFiredBatchNo.Focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.CheckFiredBatchNo();
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
@@ -1012,48 +1147,63 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
ExceptionManager.HandleEventException(this.ToString(),
|
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
}
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ btnOk.Tag = null;
|
|
|
+ btnOk.Enabled = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- private void txtKiln_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
+ private void CheckFiredBatchNo()
|
|
|
+ {
|
|
|
+ string KilnCarBatchNo = string.Format("{0}#{1}#{2}#{3}",
|
|
|
+ this._productionEntity.KilnCode,
|
|
|
+ this._productionEntity.KilnCarCode,
|
|
|
+ this.dtpFiredDate.Value.Value.ToString("yyyyMMdd"),
|
|
|
+ this.txtFiredBatchNo.DataValue.Value.ToString("000"));
|
|
|
+
|
|
|
+ ClientRequestEntity cre = new ClientRequestEntity();
|
|
|
+ cre.NameSpace = "F_PM_0504";
|
|
|
+ cre.Name = "CheckKilnCarBatchNo";
|
|
|
+ cre.Properties["KilnID"] = this._productionEntity.KilnID.Value;
|
|
|
+ cre.Properties["KilnCarID"] = this._productionEntity.KilnCarID.Value;
|
|
|
+ cre.Properties["FiredDate"] = this.dtpFiredDate.Value.Value;
|
|
|
+ cre.Properties["KilnCarBatchNo"] = KilnCarBatchNo;
|
|
|
+ cre.Properties["ProcedureID"] = this._procedureID;
|
|
|
+ cre.Properties["ModelType"] = this._procedureDataEntity.ModelType;
|
|
|
+
|
|
|
+ //ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
|
|
|
+ //{
|
|
|
+ // return PMModuleProxyNew.Service.HandleRequest(cre);
|
|
|
+ //}));
|
|
|
+ ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
|
|
|
+
|
|
|
+ if (sre == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("此窑车烧成批次不存在",
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (sre.Status == Constant.ServiceResultStatus.Other)
|
|
|
+ {
|
|
|
+ MessageBox.Show(sre.Message,
|
|
|
+ this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.txtKilnCarCode.ReadOnly = true;
|
|
|
+ this.txtKiln.ReadOnly = true;
|
|
|
+ this.txtFiredBatchNo.ReadOnly = true;
|
|
|
+ this.dtpFiredDate.Enabled = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void txtFiredBatchNo_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
|
|
|
{
|
|
|
- if (this.txtKiln.Text.Trim() == string.Empty)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.txtKiln.Text.Trim() != "")
|
|
|
- {
|
|
|
- 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;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // 保存业务系统配置
|
|
|
- Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
|
|
|
- this.txtKiln.Text.Trim(), this._iniFilePath);
|
|
|
- this.txtKilnCarCode.Focus();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ this.btnOk.Focus();
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -1064,69 +1214,32 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void btnOk_Click(object sender, EventArgs e)
|
|
|
+ private void txtFiredBatchNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (string.IsNullOrWhiteSpace(this.txtKiln.Text) || this._productionEntity.KilnID == null)
|
|
|
+ if (this.txtFiredBatchNo.ReadOnly || string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
{
|
|
|
- MessageBox.Show("没有输入窑炉", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtKiln.Focus();
|
|
|
return;
|
|
|
}
|
|
|
- if (string.IsNullOrWhiteSpace(this.txtKilnCarCode.Text) || this._productionEntity.KilnCarID == null)
|
|
|
+ // 验证烧成批次
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
|
|
|
+ this._productionEntity.KilnID == null ||
|
|
|
+ this._productionEntity.KilnID == -1)
|
|
|
{
|
|
|
- MessageBox.Show("没有输入窑车", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtKilnCarCode.Focus();
|
|
|
return;
|
|
|
}
|
|
|
- if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
+ if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
|
|
|
+ this._productionEntity.KilnCarID == null ||
|
|
|
+ this._productionEntity.KilnCarID == -1)
|
|
|
{
|
|
|
- MessageBox.Show("没有输入烧成批次", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtFiredBatchNo.Focus();
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- string KilnCarBatchNo = string.Format("{0}#{1}#{2}#{3}",
|
|
|
- this._productionEntity.KilnCode,
|
|
|
- this._productionEntity.KilnCarCode,
|
|
|
- this.dtpFiredDate.Value.Value.ToString("yyyyMMdd"),
|
|
|
- this.txtFiredBatchNo.DataValue.Value.ToString("000"));
|
|
|
-
|
|
|
- ClientRequestEntity cre = new ClientRequestEntity();
|
|
|
- cre.NameSpace = "F_PM_0504";
|
|
|
- cre.Name = "CheckKilnCarBatchNo";
|
|
|
- cre.Properties["KilnID"] = this._productionEntity.KilnID.Value;
|
|
|
- cre.Properties["KilnCarID"] = this._productionEntity.KilnCarID.Value;
|
|
|
- cre.Properties["FiredDate"] = this.dtpFiredDate.Value.Value;
|
|
|
- cre.Properties["KilnCarBatchNo"] = KilnCarBatchNo;
|
|
|
- cre.Properties["ProcedureID"] = this._procedureID;
|
|
|
- cre.Properties["ModelType"] = this._procedureDataEntity.ModelType;
|
|
|
-
|
|
|
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
|
|
|
- {
|
|
|
- return PMModuleProxyNew.Service.HandleRequest(cre);
|
|
|
- }));
|
|
|
-
|
|
|
- if (sre == null)
|
|
|
- {
|
|
|
- MessageBox.Show("此窑车烧成批次不存在",
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtFiredBatchNo.SelectAll();
|
|
|
- return;
|
|
|
- }
|
|
|
- if (sre.Status == Constant.ServiceResultStatus.Other)
|
|
|
+ if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
{
|
|
|
- MessageBox.Show(sre.Message,
|
|
|
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
- this.txtFiredBatchNo.SelectAll();
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- this.txtKilnCarCode.ReadOnly = true;
|
|
|
- this.txtKiln.ReadOnly = true;
|
|
|
- this.txtFiredBatchNo.ReadOnly = true;
|
|
|
- this.dtpFiredDate.Enabled = false;
|
|
|
+ this.CheckFiredBatchNo();
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
@@ -1135,14 +1248,5 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
|
|
|
System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- private void txtFiredBatchNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
- {
|
|
|
- if (this.txtFiredBatchNo.ReadOnly || string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- btnOk_Click(null, null);
|
|
|
- }
|
|
|
}
|
|
|
}
|