| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_0107.cs
- * 2.功能描述:成型线管理
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2015/09/15 1.00 新建
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Basics.DockPanel;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using Dongke.IBOSS.PRD.WCF.Proxys.PCModuleService;
- using Dongke.WinForm.Controls;
- namespace Dongke.IBOSS.PRD.Client.PMModule
- {
- public partial class F_PM_0107 : FormDialog
- {
- #region 成员变量
- #endregion
- #region 构造函数
- /// <summary>
- /// 构造函数
- /// </summary>
- public F_PM_0107()
- {
- InitializeComponent();
-
- // 标题
- Text = FormTitles.F_PM_0107;
- // 按钮
- btnReStart.Text = ButtonText.BTN_RESTART;
- btnClose.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 事件处理
- /// <summary>
- /// 页面加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PC_0104_Load(object sender, EventArgs e)
- {
- try
- {
- // 获取3#高压注浆线数据
- GetGroutingLine3Data();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 重启按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnReStart_Click(object sender, EventArgs e)
- {
- try
- {
- if (dgvGroutingLine.CurrentRow == null)
- {
- return;
- }
- DataRow row = (dgvGroutingLine.CurrentRow.DataBoundItem as DataRowView).Row;
- DialogResult drs = MessageBox.Show(
- string.Format("请确认是否重启高压注浆线【{0}】?确定后注浆批次号将增加,注浆批次序号将重置。", row["H_LineCode"]),
- Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
- if (drs == DialogResult.No)
- {
- return;
- }
- // 异步处理
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PM_0107";
- cre.Name = "SaveGroutingLine3";
- cre.Properties["GroutingLineID"] = row["GroutingLineID"];
- cre.Properties["H_BatchNo"] = row["H_BatchNo"];
- ServiceResultEntity sre = null;
- DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }, out sre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.OtherStatus > 0)
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "高压注浆线", "重启"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- // 获取3#高压注浆线数据
- GetGroutingLine3Data();
- }
- else if (sre.OtherStatus < 0 && !string.IsNullOrEmpty(sre.Message))
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W007, sre.Message), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "高压注浆线", "重启"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- else
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "高压注浆线", "重启"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 关闭按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClose_Click(object sender, EventArgs e)
- {
- Close();
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 获取3#高压注浆线数据
- /// </summary>
- private void GetGroutingLine3Data()
- {
- try
- {
- // 异步处理
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PM_0107";
- cre.Name = "GetGroutingLine3";
- ServiceResultEntity sre = null;
- DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }, out sre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.Data != null && sre.Data.Tables.Count > 0)
- {
- dgvGroutingLine.DataSource = sre.Data.Tables[0];
- }
- }
-
- dgvGroutingLine.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- }
- }
|