using Dongke.IBOSS.PRD.Basics.BaseControls;
using Dongke.IBOSS.PRD.Basics.BaseResources;
using Dongke.IBOSS.PRD.Client.CommonModule;
using Dongke.IBOSS.PRD.Client.Controls.SearchBox;
using Dongke.IBOSS.PRD.WCF.DataModels;
using Dongke.IBOSS.PRD.WCF.Proxys;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Dongke.IBOSS.PRD.Client.Controls.SelectForm
{
public partial class F_SAPIdnrk : DKDockPanelBase
{
#region 构造函数
public F_SAPIdnrk()
{
InitializeComponent();
}
#endregion
#region 属性
public string _IDNRK;
public string _MEINS;
public string _IDNRKNAME;
#endregion
#region 事件
///
/// 查询
///
///
///
private void tsbtnSearch_Click(object sender, EventArgs e)
{
try
{
string IDNRK = this.txtIdnrk.Text.Trim();
// 调用服务器端获取数据集
ClientRequestEntity cre = new ClientRequestEntity();
cre.NameSpace = "Hegii";
cre.Name = "GetIdnrkCode";
cre.Properties["IDNRK"] = this.txtIdnrk.Text.Trim();
cre.Properties["IDNRKNAME"] = this.txtIdnrkName.Text.Trim();
ServiceResultEntity sre = DoAsync(() =>
{
return SAPDataModuleProxy.Service.DoRequest(cre);
});
if (sre.Status == Constant.ServiceResultStatus.Success)
{
// 查询成功
this.dgvIdnrk.DataSource = sre.Data.Tables[0];
this.tsbtnAdaptive_Click(null, null);
if (this.dgvIdnrk.RowCount == 0)
{
DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_001);
}
}
}
catch (Exception ex)
{
// 对异常进行共通处理
ExceptionManager.HandleEventException(this.ToString(),
System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
}
}
///
/// 自适应列宽
///
///
///
private void tsbtnAdaptive_Click(object sender, EventArgs e)
{
this.dgvIdnrk.AutoResizeColumns();
}
///
/// 清空条件
///
///
///
private void tsbtnClear_Click(object sender, EventArgs e)
{
this.txtIdnrk.Text = null;
}
///
/// 取消
///
///
///
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
///
/// 确认
///
///
///
private void btncheck_Click(object sender, EventArgs e)
{
DataGridViewRow currentRow = this.dgvIdnrk.CurrentRow;
if (currentRow != null)
{
//this._invoiceLayoutID = Convert.ToInt32(currentRow.Cells["InvoiceLayoutID"].Value);
_IDNRK = currentRow.Cells["IDNRK"].Value.ToString();
_IDNRKNAME = currentRow.Cells["IDNRKNAME"].Value.ToString();
_MEINS = currentRow.Cells["MEINS"].Value.ToString();
this.DialogResult = DialogResult.OK;
}
}
#endregion
}
}