public override void BuildTree() { List<Customer> cuss = QuickFilterCus(icustomer.getCusByMultiFilter(searchTerm)); tv.BeginUpdate(); foreach (Customer cus in cuss) { ExtTreeNode node = new ExtTreeNode(cus.Name, "CUS"); node.Tag = cus.CustomId; tv.Nodes.Add(node); } tv.EndUpdate(); }
private ExtTreeNode FindTreeNodeInChildren(ExtTreeNode node, ExtTreeNode parent) { foreach (TreeNode curNode in parent.Nodes) { ExtTreeNode curExtNode = curNode as ExtTreeNode; if (curExtNode.Type.Equals(node.Type) && curExtNode.Tag.Equals(node.Tag)) { return curNode as ExtTreeNode; } ExtTreeNode nodeInChildren = FindTreeNodeInChildren(node, curExtNode); if (null != nodeInChildren) { return nodeInChildren; } } return null; }
public void SelectNode(ExtTreeNode node) { if (tv.Nodes.Count == 0) { return; } if (node == null) { tv.SelectedNode = tv.Nodes[0]; return; } ExtTreeNode nodeFound = FindTreeNode(node); if (null == nodeFound) { tv.SelectedNode = tv.Nodes[0]; } else { tv.SelectedNode = nodeFound; } }
private void BuildRebateTypeTree() { List<RebateType> rbTypes = icustomer.getAllRebateType(); foreach (RebateType type in rbTypes) { ExtTreeNode node = new ExtTreeNode(type.Name, "RBTYPE"); node.Tag = type.RebateTypeId; tv.Nodes.Add(node); } }
private void AddCusToRebateTypeTree(List<Customer> cuss) { foreach (TreeNode node in tv.Nodes) { ExtTreeNode exNode = node as ExtTreeNode; foreach (Customer cus in cuss) { if (cus.RebateTypeId.Equals(exNode.Tag.ToString())) { ExtTreeNode cusNode = new ExtTreeNode(cus.Name, "CUS"); cusNode.Tag = cus.CustomId; node.Nodes.Add(cusNode); } } } }
private void BuildGroupTree() { ExtTreeNode node = new ExtTreeNode("勤怠", "GROUP"); node.Tag = PayrollItemGroup.Attendence; tv.Nodes.Add(node); node = new ExtTreeNode("支付", "GROUP"); node.Tag = PayrollItemGroup.Pay; tv.Nodes.Add(node); node = new ExtTreeNode("扣除", "GROUP"); node.Tag = PayrollItemGroup.Deduct; tv.Nodes.Add(node); node = new ExtTreeNode("其他", "GROUP"); node.Tag = PayrollItemGroup.Other; tv.Nodes.Add(node); }
private void AddPayrollItemToGroup(List<PayrollItem> items) { foreach (TreeNode node in tv.Nodes) { ExtTreeNode exNode = node as ExtTreeNode; foreach (PayrollItem item in items) { if (item.Group.Equals(Convert.ToInt32(exNode.Tag))) { string type = wageBonus.Equals(WageBonus.Wage) ? "WAGEITEM" : "BONUSITEM"; ExtTreeNode itemNode = new ExtTreeNode(item.ItemName, type); itemNode.Tag = item.ItemId; itemNode.ForeColor = item.SystemItem ? Color.Gray : SystemColors.WindowText; node.Nodes.Add(itemNode); } } } }
private void BuildEmpTypeTree() { List<EmpType> empTypes = iemployee.getAllEmpType(); foreach (EmpType type in empTypes) { ExtTreeNode node = new ExtTreeNode(type.Name, "EMPTYPE"); node.Tag = type.EmpTypeID; tv.Nodes.Add(node); } }
private void AddEmpToEmpTypeTree(List<Employee> emps) { foreach (TreeNode node in tv.Nodes) { ExtTreeNode exNode = node as ExtTreeNode; foreach (Employee emp in emps) { if (emp.EmpTypeID.Equals(exNode.Tag.ToString())) { ExtTreeNode empNode = new ExtTreeNode(emp.Name + " " + emp.EmpID, "EMP"); empNode.Tag = emp.EmpID; node.Nodes.Add(empNode); } } } }
public override void BuildTree() { List<Employee> emps = QuickFilterEmp(iemployee.getEmpByMultiFilter(searchTerm)); tv.BeginUpdate(); foreach (Employee emp in emps) { ExtTreeNode node = new ExtTreeNode(emp.Name + " " + emp.EmpID, "EMP"); node.Tag = emp.EmpID; tv.Nodes.Add(node); } tv.EndUpdate(); }
private void AddEmpToNode(ExtTreeNode parent, List<EmpFormEntity> formEmps) { foreach (TreeNode node in parent.Nodes) { AddEmpToNode(node as ExtTreeNode, formEmps); } foreach (EmpFormEntity formEmp in formEmps) { if (formEmp.BelongToDept(parent.Tag.ToString())) { ExtTreeNode node = new ExtTreeNode(formEmp.Employee.Name + " " + formEmp.Employee.EmpID, "EMP"); node.Tag = formEmp.Employee.EmpID; parent.Nodes.Add(node); } } }
public override void BuildTree() { List<Department> depts = QuickFilterDept(icompany.getAllDept()); foreach (Department dept in depts) { if (!ParentExisted(dept, depts)) { ExtTreeNode node = new ExtTreeNode(dept.Name + " " + dept.Code, "DEPT"); node.Tag = dept.DeptId; AddChildren(node, depts); tv.Nodes.Add(node); } } }
public void AddChildren(ExtTreeNode parent, List<Department> depts) { foreach (Department dept in depts) { if (dept.ParentDeptId.Equals(parent.Tag.ToString())) { ExtTreeNode node = new ExtTreeNode(dept.Name + " " + dept.Code, "DEPT"); node.Tag = dept.DeptId; AddChildren(node, depts); parent.Nodes.Add(node); } } }
private void BuildCusTypeTree() { List<CusType> cusTypes = icustomer.getAllCusType(); foreach (CusType type in cusTypes) { ExtTreeNode node = new ExtTreeNode(type.Name, "CUSTYPE"); node.Tag = type.CusTypeId; tv.Nodes.Add(node); } }
private void SelectTreeNode(ExtTreeNode node) { tree.SelectNode(node); }