Exemplo n.º 1
0
        private void GetSubTree(ref TreeViewItem iSubTree, CompanyDataSet.DepartmentRow department)
        {
            var employees = department.GetEmployeeRows();

            foreach (var employee in employees)
            {
                var ep = new EmployeeDetailsPage(employee.employee_id);
                ep.OnEmployeeChanged += (s, e) => ((TreeViewItem)treeCompany.SelectedItem).Header = e.Name;

                var subItem = new TreeViewItem
                {
                    Header = employee.PersonRow.Name,
                    Tag    = ep
                };
                iSubTree.Items.Add(subItem);
            }

            foreach (var subDept in department.GetDepartmentRows())
            {
                var subItem = new TreeViewItem
                {
                    Header = subDept.Name,
                    Tag    = new DepartmentDetailsPage(subDept.department_id)
                };
                iSubTree.Items.Add(subItem);
                GetSubTree(ref subItem, subDept);
            }
        }
Exemplo n.º 2
0
        private void GetSubTree(ref TreeViewItem iSubTree, CompanyDataSet.DepartmentRow department)
        {
            var employees = department.GetEmployeeRows();

            foreach (var employee in employees)
            {
                var ep = new EmployeeDetailsPage(employee.employee_id);
                ep.OnEmployeeChanged += (s, e) => ((TreeViewItem) treeCompany.SelectedItem).Header = e.Name;

                var subItem = new TreeViewItem
                {
                    Header = employee.PersonRow.Name,
                    Tag = ep
                };
                iSubTree.Items.Add(subItem);
            }

            foreach (var subDept in department.GetDepartmentRows())
            {
                var subItem = new TreeViewItem
                {
                    Header = subDept.Name,
                    Tag = new DepartmentDetailsPage(subDept.department_id)
                };
                iSubTree.Items.Add(subItem);
                GetSubTree(ref subItem, subDept);
            }
        }