public void Search(object sender, EventArgs e) { if (((FrmMAIN)this.MdiParent).ActiveMdiChild == this) { try { FactoryService service = new FactoryService(); dgvFactoryList.DataSource = null; dgvFactoryList.DataSource = service.GetSearchFactoryInfo(txtFactoryCode.Text, cboCategory.Text); } catch (Exception err) { _logging = new LoggingUtility(this.Name, Level.Info, 30); } } }