/// <summary> /// LoadList /// </summary> void LoadList() { using (ProxyDictionary proxy = new ProxyDictionary()) { DataSourceEmpList = proxy.Service.LoadEmpInfo(); DataSourceEmpList.Sort(); Viewer.gcEmployee.DataSource = DataSourceEmpList; } }
/// <summary> /// FilterDept /// </summary> /// <param name="deptCode"></param> void FilterDept(string deptCode) { if (DataSourceEmpList != null) { if (string.IsNullOrEmpty(deptCode)) { Viewer.gcEmployee.DataSource = DataSourceEmpList; } else { Viewer.colDeptName.Visible = false; Viewer.gcEmployee.DataSource = DataSourceEmpList.FindAll(t => t.deptCode == deptCode); } } }
/// <summary> /// FindEmp /// </summary> /// <param name="val"></param> internal void FindEmp(string val) { if (string.IsNullOrEmpty(val)) { DialogBox.Msg("请输入快速查找条件。"); Viewer.txtFind.Focus(); return; } if (DataSourceEmpList != null) { Viewer.colDeptName.Visible = true; Viewer.gcEmployee.DataSource = DataSourceEmpList; int index = DataSourceEmpList.FindIndex(t => t.operCode == val || t.operName.StartsWith(val) || t.pyCode.StartsWith(val) || t.wbCode.StartsWith(val)); if (index >= 0) { Viewer.gvEmployee.FocusedRowHandle = index; } } }