private void LoadTv() { if (dept_lis != null && dept_lis.Count > 0) { this.dept_lis.Clear(); } this.tv.Nodes.Clear(); IBLL.IDept bll = new BLL.DeptBLL(); dept_lis = bll.GetAllList(); TreeNode tn = new TreeNode("所有部门"); tn.Tag = ""; this.tv.Nodes.Add(tn); LoadTreeView(); this.tv.Nodes[0].Expand(); }
private void LoadCb() { //部门 IBLL.IDept bll = new BLL.DeptBLL(); var list = bll.GetAllList(); this.cbDept.DisplayMember = "dept_name"; this.cbDept.ValueMember = "dept_no"; this.cbDept.DataSource = list; //状态 Dictionary <string, string> dic = new Dictionary <string, string>() { { "1", "在职" }, { "0", "离职" }, }; this.cbStatus.DisplayMember = "Value"; this.cbStatus.ValueMember = "Key"; this.cbStatus.DataSource = new BindingSource(dic, null); }
public void LoadItemCls() { try { Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IDept bll = new BLL.DeptBLL(); var lis = bll.GetAllList(); this.Invoke((MethodInvoker) delegate { Cursor.Current = Cursors.WaitCursor; dept_lis = lis; this.tvRegion.Nodes[0].Nodes.Clear(); LoadTreeView(); // this.tvRegion.Nodes[0].Expand(); Cursor.Current = Cursors.Default; }); } catch (Exception ex) { LogHelper.writeLog("frmDept=>LoadItemCls", "获取部门分类出错!"); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); } catch (Exception ex) { LogHelper.writeLog("frmDept=>LoadItemCls", "获取部门分类出错!"); MsgForm.ShowFrom(ex); } }
private void frmPeople_Load(object sender, EventArgs e) { try { Thread th = new Thread(() => { Helper.GlobalData.windows.ShowLoad(this); try { IBLL.IDept bll = new BLL.DeptBLL(); dept_lis = bll.GetAllList(); this.Invoke((MethodInvoker) delegate { Cursor.Current = Cursors.WaitCursor; LoadTv(); LoadDataGrid(); Cursor.Current = Cursors.Default; }); } catch (Exception ex) { LogHelper.writeLog("frmDept=>LoadItemCls", "获取商品分类出错!"); MsgForm.ShowFrom(ex); } Helper.GlobalData.windows.CloseLoad(this); }); th.Start(); } catch (Exception ex) { MsgForm.ShowFrom(ex); LogHelper.writeLog("frmPeople=>load", ex.ToString()); } finally { } }