private void LoadTree() { try { this.Cursor = Cursors.WaitCursor; tvLeft.AllowDrop = true; tvLeft.Nodes.Clear(); tvLeft.ImageList = Util.GetImageList(); dalProductTypeList dal = new dalProductTypeList(); BindingCollection <modProductTypeList> list = dal.GetIList(true, out Util.emsg); if (list != null) { foreach (modProductTypeList mod in list) { tvLeft.Nodes.Add(mod.ProductType, mod.ProductType, 0, 1); } if (tvLeft.Nodes.Count > 0) { tvLeft.SelectedNode = tvLeft.Nodes[0]; } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void LoadData() { BindingCollection <modProductTypeList> list = _dal.GetIList(false, out Util.emsg); DBGrid.DataSource = list; DBGrid.Enabled = true; if (list != null) { AddComboBoxColumns(); Status1 = DBGrid.Rows.Count.ToString(); Status2 = clsTranslate.TranslateString("Refresh"); } else { DBGrid.DataSource = null; MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }