| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- 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);
- }
- /// <summary>
- /// 查询物料
- /// </summary>
- private void getMat(string MrId)
- {
- EntityPurPlanD eppd = new EntityPurPlanD();
- //eppd = this.execute<EntityPurPlanD>("com.hnshituo.pur.purplan.service.PurPlanDService", "findById", new object[] { MrLineId });
- eppd = new EntityPurPlanD();
- eppd.MrId = MrId;
- eppd.Validflag = "1";
- DataTable dt_mat = this.execute<DataTable>("com.hnshituo.pur.purplan.service.PurPlanDService", "find", new object[] { eppd, 0, 0 });
- GridHelper.CopyDataToDatatable(ref dt_mat, ref dataTable2, true);//绑定物料分类表
- }
- /// <summary>
- /// 选中物料
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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();
- }
- /// <summary>
- /// 按钮控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- 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;
- }
- }
- /// <summary>
- /// 初始化界面加载数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void FrmMatByMrIdChk_Load(object sender, EventArgs e)
- {
- }
- }
- }
|