public override void UpdateView(Webb.Reports.ExControls.Views.ExControlView i_View) { if (this.C_GroupInfoTree.Nodes.Count <= 0) { return; } GroupInfo m_GroupInfo = this.C_GroupInfoTree.Nodes[0].Tag as GroupInfo; this.UpdateView(m_GroupInfo, this.C_GroupInfoTree.Nodes[0]); SimpleGroupView m_SimpleGroupView = i_View as SimpleGroupView; m_SimpleGroupView.HaveHeader = this.C_CheckHeader.Checked; GroupInfo m_RootGroupInfo = this.C_GroupInfoTree.Nodes[0].Tag as GroupInfo; if (m_SimpleGroupView.RootGroupInfo is SectionGroupInfo) { m_SimpleGroupView.RootGroupInfo.SubGroupInfos.Clear(); m_SimpleGroupView.RootGroupInfo.SubGroupInfos.Add(m_RootGroupInfo); } else { m_SimpleGroupView.RootGroupInfo = m_RootGroupInfo; } }
public GetGeneralResponse <IEnumerable <SimpleGroupView> > GetSimpleGroup() { GetGeneralResponse <IEnumerable <SimpleGroupView> > response = new GetGeneralResponse <IEnumerable <SimpleGroupView> >(); IEnumerable <Group> groups = _groupRepository.FindAll(); var _groups = new List <SimpleGroupView>(); foreach (var item in groups) { SimpleGroupView simple = new SimpleGroupView(); simple.GroupName = item.GroupName; simple.ID = item.ID; Infrastructure.Querying.Query query = new Infrastructure.Querying.Query(); Criterion employeectr = new Criterion("Group.ID", item.ID, CriteriaOperator.Equal); query.Add(employeectr); IEnumerable <Employee> employee = _employeeRepository.FindBy(query); var simpleEmployee = new List <SimpleEmployeeView>(); foreach (var _item in employee) { simpleEmployee.Add(new SimpleEmployeeView() { EmployeeID = _item.ID, ID = _item.ID, Name = _item.FirstName + " " + _item.LastName, FirstName = _item.LastName, LastName = _item.LastName, Discontinued = _item.Discontinued }); } simple.Employees = simpleEmployee; _groups.Add(simple); } response.data = _groups; response.totalCount = _groups.Count(); return(response); }
public override void SetView(Webb.Reports.ExControls.Views.ExControlView i_View) { this.C_GroupInfoTree.Nodes.Clear(); SimpleGroupView m_SimpleGroupView = i_View as SimpleGroupView; this.C_CheckHeader.Checked = m_SimpleGroupView.HaveHeader; GroupInfo m_GroupInfo = null; if (m_SimpleGroupView.RootGroupInfo is SectionGroupInfo) { if (m_SimpleGroupView.RootGroupInfo.SubGroupInfos.Count > 0) { m_GroupInfo = m_SimpleGroupView.RootGroupInfo.SubGroupInfos[0]; } } else { m_GroupInfo = m_SimpleGroupView.RootGroupInfo; } this.SetView(m_GroupInfo, null); }