| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- 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 Core.StlMes.Client.YdmPipeManage.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- namespace Core.StlMes.Client.YdmPipeManage.Dialog
- {
- public partial class FrmEnterMaterialDialog : FrmBase
- {
- //private string _materialNo;
- private OpeBase _ob;
-
- private ComPscEntity pscEntity = null;
- public ComPscEntity PscEntity
- {
- get { return pscEntity; }
- set { pscEntity = value; }
- }
- public FrmEnterMaterialDialog(OpeBase ob)
- {
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- InitializeComponent();
- // _materialNo = materialNo;
- _ob = ob;
- }
- private void FrmMaterialDialog_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<ComPscEntity>(UltraGridPsc.DisplayLayout.Bands[0]);
- BaseMethod.setOtherColumnReadOnly(UltraGridPsc, new string[] { "Chc" });
- DoQueryPsc();
- }
- private void DoQueryPsc()
- {
- List<ComPscEntity> listSource = EntityHelper.GetData<ComPscEntity>(
- "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getPsc", new object[] { }, _ob);
- comPscEntityBindingSource.DataSource = listSource;
- }
- //private void ActiveRow()
- //{
- // if (_materialNo.Length == 0)
- // {
- // return;
- // }
- // foreach (UltraGridRow ugr in UltraGridMaterial.Rows)
- // {
- // if (ugr.Cells[""].Value.ToString().Equals(_materialNo))
- // {
- // ugr.Activate();
- // ugr.Appearance.BackColor = Color.GreenYellow;
- // }
- // }
- //}
- //private void UltraGridPsc_AfterRowActivate(object sender, EventArgs e)
- //{
- // UltraGridRow ugr = UltraGridPsc.ActiveRow;
- // if (ugr == null)
- // {
- // //DoQueryMaterial("", "", "");
- // return;
- // }
- // string producCode = ugr.Cells["Produccode"].Text;
- // string steelCode = ugr.Cells["Steelcode"].Text;
- // string stdStyle = ugr.Cells["StdStyle"].Text;
- // //DoQueryMaterial(producCode, steelCode, stdStyle);
- //}
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Ensure":
- ensureData();
- break;
- case"Close":
- CloseForm();
- break;
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- private void CloseForm()
- {
- pscEntity = null;
- this.Close();
- }
- /// <summary>
- /// 确认选择数据
- /// </summary>
- private void ensureData()
- {
- UltraGridRow ugrP = UltraGridPsc.ActiveRow;
- if (ugrP == null)
- {
- MessageUtil.ShowTips("请选择相应物料信息!");
- return;
- }
- pscEntity = (ComPscEntity)ugrP.ListObject;
- this.Close();
- }
- private void UltraGridPsc_DoubleClick(object sender, EventArgs e)
- {
- UltraGridRow ugrP = UltraGridPsc.ActiveRow;
- if (ugrP == null)
- {
- MessageUtil.ShowTips("请选择相应物料信息!");
- return;
- }
- pscEntity = (ComPscEntity)ugrP.ListObject;
- this.Close();
- }
- }
- }
|