using Estsh.Client; namespace Com.Estsh.MES.AssemblyInput { public partial class YYNGCheck :Form { /// /// 返回工位值 /// private string _input = string.Empty; public string Input { get { return _input; } } //工位 public int _terminalID; //区段 public int stegeid; public string _sn; public string _parent_desc; private StepLibraryAPP _app = null; private int Inum = 1; private List dtNGCheck = null; public YYNGCheck(StepLibraryAPP app, string sn, int terminalID, string parent_desc) { _app = app; _terminalID = terminalID; _sn = sn; _parent_desc=parent_desc; InitializeComponent(); } private void YYNGCheck_Load(object sender, EventArgs e) { if (_parent_desc == "错漏装") { dtNGCheck = _app.YYNGKpsnCheck(_sn, _terminalID); } else { dtNGCheck = _app.YYNGKeyDataCheck(_sn, _terminalID); } dgNGCheck.AutoGenerateColumns = false; dgNGCheck.DataSource = dtNGCheck; } private YYNGFacadeCheck yyNGFacadeCheck; private void btnNextStep_Click(object sender, EventArgs e) { if (yyNGFacadeCheck == null) //如果子窗体为空则创造实例 并显示 { this.Hide(); yyNGFacadeCheck = new YYNGFacadeCheck(_app, _sn, _terminalID, _parent_desc); yyNGFacadeCheck.StartPosition = FormStartPosition.CenterScreen;//子窗体居中显示 yyNGFacadeCheck.ShowDialog(); } else if (yyNGFacadeCheck.IsDisposed) //若子窗体关闭 则打开新子窗体 并显示 { yyNGFacadeCheck = new YYNGFacadeCheck(_app, _sn, _terminalID, _parent_desc); yyNGFacadeCheck.StartPosition = FormStartPosition.CenterScreen;//子窗体居中显示 yyNGFacadeCheck.Show(); } else { this.Show(); } } } }