using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Stone.WinBiz.BasicData; using Stone.Common; namespace Stone.WinModule.BasicData { public partial class frmFeature : Stone.WinModule.BasicData.frmBaseMain { public frmFeature() { InitializeComponent(); } public override void Search(string code) { base.Search(code); strWhere += " or [Name] like '%" + code + "%'"; strWhere += " or [Memo] like '%" + code + "%'"; } private void frmFeature_Load(object sender, EventArgs e) { ToolStripButton btnPart = new ToolStripButton("零件设置"); btnPart.Image = this.imageList1.Images[0]; btnPart.TextImageRelation = TextImageRelation.ImageAboveText; btnPart.Click += new EventHandler(btnPart_Click); this.toolStrip1.Items.Insert(0, btnPart); } private void btnPart_Click(object sender, EventArgs e) { try { if (this.dgrdView.SelectedRows.Count == 0) throw new Exception("请选择设置零件的记录"); string Code = this.dgrdView.SelectedRows[0].Cells["Code"].Value.ToString(); F_FeaturePart f_FeaturePart = new F_FeaturePart(); f_FeaturePart.FeatureCode = Code; frmFeaturePart frm = new frmFeaturePart(); frm.m_Base = f_FeaturePart; frm.init(); frm.Text = Code + " 匹配特征零件设置"; frm.ShowDialog(); frm.Dispose(); } catch (Exception ex) { MyMessageBox.ShowErrorMessage(ex.Message); } } } }