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(UltraGridPsc.DisplayLayout.Bands[0]); BaseMethod.setOtherColumnReadOnly(UltraGridPsc, new string[] { "Chc" }); DoQueryPsc(); } private void DoQueryPsc() { List listSource = EntityHelper.GetData( "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; } } /// /// 关闭 /// private void CloseForm() { pscEntity = null; this.Close(); } /// /// 确认选择数据 /// 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(); } } }