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;
using Pur.Entity.configureEntity;
using Core.Mes.Client.Comm.Control;
using CoreFS.CA06;using Pur.Entity;
using Core.Mes.Client.Comm.Tool;
using Infragistics.Win;
using Pur.Entity;
namespace Pur.Pop_upWindow
{
public partial class FrmMatByMrIdChk : FrmPmsBase
{
private DataTable q_dt = null;
public DataTable Q_dt
{
get { return q_dt; }
}
public FrmMatByMrIdChk(OpeBase ob, string MrId)
{
InitializeComponent();
this.ob = ob;
GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], "Check");
getMat(MrId);
}
///
/// 查询物料
///
private void getMat(string MrId)
{
EntityPurPlanD eppd = new EntityPurPlanD();
//eppd = this.execute("com.hnshituo.pur.purplan.service.PurPlanDService", "findById", new object[] { MrLineId });
eppd = new EntityPurPlanD();
eppd.MrId = MrId;
eppd.Validflag = "1";
DataTable dt_mat = this.execute("com.hnshituo.pur.purplan.service.PurPlanDService", "find", new object[] { eppd, 0, 0 });
GridHelper.CopyDataToDatatable(ref dt_mat, ref dataTable2, true);//绑定物料分类表
}
///
/// 选中物料
///
///
///
private void getPurPlanD()
{
ultraGrid1.UpdateData();
DataTable dt = dataTable2.Clone();
for (int i = 0; i < ultraGrid1.Rows.Count; i++)
{
if ((bool)ultraGrid1.Rows[i].Cells["Check"].Value)
{
for (int j = 0; j < dataTable2.Rows.Count; j++)
{
if (ultraGrid1.Rows[i].Cells["ITEMCODE"].Value.ToString() == dataTable2.Rows[j]["ITEMCODE"].ToString())
{
DataRow dr = dataTable2.Rows[j];
dt.Rows.Add(dr.ItemArray);
break;
}
}
}
}
if (dt.Rows.Count > 0)
{
q_dt = dt;
}
else
{
MessageUtil.ShowTips("请选择物料");
return;
}
this.Close();
}
///
/// 按钮控件
///
///
///
private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
{
switch (e.Tool.Key.ToString())
{
case "Query":
{
}
break;
case "conFirmation":
{
getPurPlanD();
}
break;
case "ESC":
{
this.Close();
}
break;
}
}
///
/// 初始化界面加载数据
///
///
///
private void FrmMatByMrIdChk_Load(object sender, EventArgs e)
{
}
}
}