using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using System; using System.Data; using System.Linq; using System.Windows.Forms; namespace Core.StlMes.Client.Qcm { public partial class ComBaseSplineCopyStdFrm : FrmBase { public string OldStdName { get; set; } public string OldStdCode { get; set; } public string NewStdName { get; set; } public string NewStdCode { get; set; } public ComBaseSplineCopyStdFrm(OpeBase ob) { InitializeComponent(); this.ob = ob; } private void UltraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.GetBLStd", new object[] { }, ob); dt.Columns["STD_NAME"].Caption = "标准名称"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("STD_CODE") == ultraTextEditor1.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == DialogResult.OK) { ultraTextEditor1.Tag = baseInfo.ChoicedRow.GetValue("STD_CODE"); ultraTextEditor1.Text = baseInfo.ChoicedRow.GetValue("STD_NAME"); } } private void UltraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.GetBLStd", new object[] { }, ob); dt.Columns["STD_NAME"].Caption = "标准名称"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("STD_CODE") == ultraTextEditor2.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == DialogResult.OK) { ultraTextEditor2.Tag = baseInfo.ChoicedRow.GetValue("STD_CODE"); ultraTextEditor2.Text = baseInfo.ChoicedRow.GetValue("STD_NAME"); } } private void UltraButton1_Click(object sender, EventArgs e) { if (ultraTextEditor1.Text == "") { MessageUtil.ShowTips("请选择旧标准"); return; } if (ultraTextEditor2.Text == "") { MessageUtil.ShowTips("请选择新标准"); return; } OldStdName = ultraTextEditor1.Text; OldStdCode = ultraTextEditor1.Tag.ToString2(); NewStdName = ultraTextEditor2.Text; NewStdCode = ultraTextEditor2.Tag.ToString2(); this.DialogResult = DialogResult.OK; } } }