private void btn_Search_Click(object sender, EventArgs e) { try { int start, end; if (!int.TryParse(tb_StartId.Text, out start)) { start = 0; } if (!int.TryParse(tb_EndId.Text, out end)) { end = 100000000; } filter = string.Format("{0} >= {1} AND {0} <= {2} AND ({0} LIKE '%{4}%' OR {3} LIKE '%{4}%')", args.column_id, start, end, args.column_name, tb_Keyword.Text); cur_dataView.RowFilter = filter; args.start_id = tb_StartId.Text; args.end_id = tb_EndId.Text; XMLController.WriteTableSearchXML(); InitTable(); } catch (Exception ex) { ConfigUtils.Error(ex.Message, ex.StackTrace); if (ex.InnerException != null) { ConfigUtils.Error(ex.InnerException.Message, ex.InnerException.StackTrace); } } }
//更新TreeView private void refreshTreeView() { try { tv_table.BeginUpdate(); tv_table.Nodes.Clear(); tableNodeList = XMLController.ReadTableTreeXML(); foreach (Node node in tableNodeList) { TreeNode tnode = new TreeNode(node.bookname); tnode.ContextMenuStrip = cms_TableNode; if (modifyNodeList.Contains(node.bookname)) { tnode.ForeColor = System.Drawing.Color.Red; } foreach (string name in node.sheetname) { TreeNode sNode = new TreeNode(name); sNode.ContextMenuStrip = cms_TableNode; tnode.Nodes.Add(sNode); } tv_table.Nodes.Add(tnode); } tv_table.EndUpdate(); } catch (Exception ex) { ConfigUtils.Error(ex.Message, ex.StackTrace); MessageBox.Show("Error: " + ex.Message); } }
public MainForm() { InitializeComponent(); ConfigUtils.init(); //读取设置文件 XMLController.ReadConfigXML(); XMLController.ReadTableSearchXML(); }
private void btn_Ok_Click(object sender, EventArgs e) { Setting.tablePath = tb_table.Text; Setting.tortoiseSvnPath = tb_tortoise_svn.Text; Setting.svnPath = tb_svn.Text; Setting.pythonPath = tb_python.Text; XMLController.WriteConfigXML(); this.Close(); }
//刷新列表 private void bw_ReloadTableXML_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { BackgroundWorker bw = sender as BackgroundWorker; if (XMLController.WriteTableTreeXML(Setting.tablePath + Setting.EXCEL, bw) == false) { e.Cancel = true; } }