/*******************************************************************************
* 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 构造函数
///
/// 构造函数
///
public F_PM_0107()
{
InitializeComponent();
// 标题
Text = FormTitles.F_PM_0107;
// 按钮
btnReStart.Text = ButtonText.BTN_RESTART;
btnClose.Text = ButtonText.BTN_CLOSE;
}
#endregion
#region 事件处理
///
/// 页面加载事件
///
///
///
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);
}
}
///
/// 重启按钮点击事件
///
///
///
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);
}
}
///
/// 关闭按钮点击事件
///
///
///
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
#endregion
#region 私有方法
///
/// 获取3#高压注浆线数据
///
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
}
}