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 CoreFS.CA06; using Core.Mes.Client.Comm.Tool; using System.Collections; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.Lims.Data.Steer { public partial class WinSteerSelectData : FrmBase { private OpeBase _ob; public OpeBase Ob { get { return _ob; } set { _ob = value; } } private UltraGridRow ugRow;//选择的Row 返回AddPhyItems public UltraGridRow UgRow { get { return ugRow; } set { ugRow = value; } } private string[] arrId; public WinSteerSelectData() { InitializeComponent(); } public WinSteerSelectData(string[] arrId_) { InitializeComponent(); arrId = arrId_; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;//不默认加载筛选条件框 } private void WinSteerSelectData_Load(object sender, EventArgs e) { InitColumns(); PublicSteer.ColumnsWidth(ultraGrid1, 0, 60); //QueryCheckConsignDetailPhyDetail(); } private void InitColumns() { string[] chemMax = PublicSteer.chemMax.Split(' '); string[] chemMin = PublicSteer.chemMin.Split(' '); string[] arrColumnsBase = new string[] { "HEAT_NO", "SAMPLE_NO", "SAMPLE_SOURCE" }; string[] arrCaptionBase = new string[] { "炉号", "试样号", "来源" }; PublicSteer.InitColumns(arrColumnsBase, chemMax, arrCaptionBase, chemMin, dataTable1); PublicSteer.setColumnShowOrHidden(ultraGrid1, new string[] { "SAMPLE_SOURCE" }, false); PublicSteer.setOtherColumnReadOnly(ultraGrid1, null); } private void QueryCheckConsignDetailPhyDetail() { try { if (txtQueryHEAT_NO.Text.Trim() == "") { MessageUtil.ShowWarning("查询炉号不能为空!"); return; } dataTable1.Rows.Clear(); ArrayList arrayList = new ArrayList(); arrayList.Add(txtQueryHEAT_NO.Text.Trim()); DataTable dt = PublicServer.GetData("com.steering.lims.data.steer.FrmSteerDataCollect.QueryChemAuditResult_Old", new Object[] { arrayList, arrId }, _ob); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowWarning("没有查到此炉信息!"); return; } GridHelper.CopyDataToDatatable(dt, dataTable1, true);//把dt复制给dataTable1 //GridHelper.RefreshAndAutoSize(ultraGrid1); } catch (Exception ex) { MessageUtil.ShowWarning(ex.Message); } } private void ultraGrid1_DoubleClick(object sender, EventArgs e) { if (ultraGrid1.ActiveRow == null || ultraGrid1.ActiveRow.Activated == false) { MessageUtil.ShowWarning("请点击一条信息!"); return; } this.ugRow = ultraGrid1.ActiveRow; this.DialogResult = DialogResult.OK; } private void btnOk_Click(object sender, EventArgs e) { QueryCheckConsignDetailPhyDetail(); } } }