Exemplo n.º 1
0
 public void AddGroupList(System.Collections.Generic.List <GetIsMark> getIsMark)
 {
     try
     {
         this.GroupName.Items.Clear();
         this.GroupNode.Clear();
         for (int i = 0; i < getIsMark.Count; i++)
         {
             foreach (EntGroup gp in this.groups)
             {
                 if (gp.Gid == getIsMark[i].id)
                 {
                     this.group = gp;
                     break;
                 }
             }
             if (this.group != null)
             {
                 if (!this.GroupNode.ContainsKey(this.group.Gid))
                 {
                     MsgCenterTreeNode node = new MsgCenterTreeNode(this.group, true);
                     node.SessionService = this.sessionService;
                     node.DataService    = this.dataService;
                     this.GroupNode.Add(this.group.Gid, node);
                     this.GroupName.Items.Add(node);
                 }
             }
             this.group = null;
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
Exemplo n.º 2
0
 private IDKin.IM.Core.Staff IsDepartStaff(MsgCenterTreeNode infom, long Departid)
 {
     IDKin.IM.Core.Staff staff = null;
     System.Collections.Generic.ICollection <MsgCenterTreeNode> stafflist = this.staffNode.Values;
     IDKin.IM.Core.Department Currentdepart = this.dataService.GetDepartment(Departid);
     IDKin.IM.Core.Staff      result;
     foreach (MsgCenterTreeNode node in stafflist)
     {
         if (node.Staff.Uid == infom.Staff.Uid && node.Staff.DepartmentId == Departid)
         {
             staff = (result = node.Staff);
             return(result);
         }
     }
     System.Collections.Generic.IList <long> id = new System.Collections.Generic.List <long>();
     this.GetClickdepart.Clear();
     id.Add(Departid);
     System.Collections.Generic.IList <IDKin.IM.Core.Department> depart = this.GetDepart(id, this.departlist);
     foreach (IDKin.IM.Core.Department dep in depart)
     {
         foreach (MsgCenterTreeNode node in stafflist)
         {
             if (node.Staff.Uid == infom.Staff.Uid && node.Staff.DepartmentId == dep.Id)
             {
                 staff = (result = node.Staff);
                 return(result);
             }
         }
     }
     result = staff;
     return(result);
 }
Exemplo n.º 3
0
 private void ShowEntGroup()
 {
     System.Collections.Generic.ICollection <EntGroup> groups = null;
     try
     {
         groups = this.dataService.GetEntGroupList();
     }
     catch (System.Exception e)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
     if (groups != null && groups.Count > 0)
     {
         foreach (EntGroup group in groups)
         {
             if (!this.GroupNode.ContainsKey(group.Gid))
             {
                 MsgCenterTreeNode node = new MsgCenterTreeNode(group, false);
                 node.SessionService = this.sessionService;
                 node.DataService    = this.dataService;
                 this.GroupNode.Add(group.Gid, node);
                 this.GroupName.Items.Add(node);
             }
         }
         System.GC.Collect();
     }
 }
Exemplo n.º 4
0
 public void AddStaff(Staff staff)
 {
     try
     {
         if (staff != null)
         {
             System.Threading.Monitor.Enter(this.staffNode);
             if (!this.staffNode.ContainsKey(staff.Uid) && this.departmentNode.ContainsKey(staff.DepartmentId))
             {
                 MsgCenterTreeNode node = new MsgCenterTreeNode(staff, false);
                 node.SessionService = this.sessionService;
                 node.DataService    = this.dataService;
                 if (!this.staffNode.ContainsKey(staff.Uid))
                 {
                     this.staffNode.Add(staff.Uid, node);
                     this.departmentNode[staff.DepartmentId].Items.Add(node);
                 }
             }
             System.Threading.Monitor.Exit(this.staffNode);
         }
     }
     catch (System.Exception ex)
     {
         System.Console.WriteLine(ex.ToString());
     }
 }
Exemplo n.º 5
0
 public void NodeExpand(long id, bool IsStaff)
 {
     if (this.node != null)
     {
         this.node.Bd.Visibility = Visibility.Collapsed;
     }
     if (!IsStaff)
     {
         this.GroupName.IsExpanded = true;
         this.node = this.GroupNode[id];
         if (this.node != null)
         {
             this.node.Focusable = true;
             this.node.Focus();
             this.node.Bd.Visibility = Visibility.Visible;
         }
     }
     else
     {
         System.Collections.Generic.List <Department> list = new System.Collections.Generic.List <Department>();
         Staff staff = this.dataService.GetStaff(id);
         if (staff != null)
         {
             Department depart = this.dataService.GetDepartment(staff.DepartmentId);
             list.Add(depart);
             while (depart.Pid != 0L)
             {
                 depart = this.dataService.GetDepartment(depart.Pid);
                 if (depart == null)
                 {
                     break;
                 }
                 list.Add(depart);
             }
             for (int i = list.Count - 1; i >= 0; i--)
             {
                 long temp = list[i].Id;
                 this.departmentNode[temp].IsExpanded = true;
             }
             if (this.node != null)
             {
                 this.node.Bd.Visibility = Visibility.Collapsed;
             }
             this.node = this.staffNode[id];
             if (this.node != null)
             {
                 this.node.Focusable = true;
                 this.node.Focus();
                 this.node.Bd.Visibility = Visibility.Visible;
             }
         }
     }
 }
Exemplo n.º 6
0
 public void AddMarkList(System.Collections.Generic.List <GetIsMark> getIsMark)
 {
     try
     {
         this.staffNode.Clear();
         this.departmentNode.Clear();
         this.departlist.Clear();
         System.Collections.Generic.ICollection <IDKin.IM.Core.Staff> stafflist = this.dataService.GetStaffList();
         IDKin.IM.Core.Staff staff = null;
         for (int i = 0; i < getIsMark.Count; i++)
         {
             foreach (IDKin.IM.Core.Staff st in stafflist)
             {
                 if (st.Uid == getIsMark[i].id)
                 {
                     staff = st;
                     break;
                 }
             }
             if (staff != null)
             {
                 System.Threading.Monitor.Enter(this.staffNode);
                 if (!this.staffNode.ContainsKey(staff.Uid) && this.sessionService.Uid != staff.Uid)
                 {
                     MsgCenterTreeNode node = new MsgCenterTreeNode(staff, true);
                     node.SessionService = this.sessionService;
                     node.DataService    = this.dataService;
                     if (!this.staffNode.ContainsKey(staff.Uid))
                     {
                         this.staffNode.Add(staff.Uid, node);
                         this.AddDepart(staff.Uid);
                         this.departmentNode[staff.DepartmentId].Items.Add(node);
                     }
                 }
                 System.Threading.Monitor.Exit(this.staffNode);
             }
             staff = null;
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
Exemplo n.º 7
0
 private void ShowEntGroup()
 {
     System.Collections.Generic.ICollection<EntGroup> groups = null;
     try
     {
         groups = this.dataService.GetEntGroupList();
     }
     catch (System.Exception e)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
     if (groups != null && groups.Count > 0)
     {
         foreach (EntGroup group in groups)
         {
             if (!this.GroupNode.ContainsKey(group.Gid))
             {
                 MsgCenterTreeNode node = new MsgCenterTreeNode(group, false);
                 node.SessionService = this.sessionService;
                 node.DataService = this.dataService;
                 this.GroupNode.Add(group.Gid, node);
                 this.GroupName.Items.Add(node);
             }
         }
         System.GC.Collect();
     }
 }
Exemplo n.º 8
0
 public void NodeExpand(long id, bool IsStaff)
 {
     if (this.node != null)
     {
         this.node.Bd.Visibility = Visibility.Collapsed;
     }
     if (!IsStaff)
     {
         this.GroupName.IsExpanded = true;
         this.node = this.GroupNode[id];
         if (this.node != null)
         {
             this.node.Focusable = true;
             this.node.Focus();
             this.node.Bd.Visibility = Visibility.Visible;
         }
     }
     else
     {
         System.Collections.Generic.List<Department> list = new System.Collections.Generic.List<Department>();
         Staff staff = this.dataService.GetStaff(id);
         if (staff != null)
         {
             Department depart = this.dataService.GetDepartment(staff.DepartmentId);
             list.Add(depart);
             while (depart.Pid != 0L)
             {
                 depart = this.dataService.GetDepartment(depart.Pid);
                 if (depart == null)
                 {
                     break;
                 }
                 list.Add(depart);
             }
             for (int i = list.Count - 1; i >= 0; i--)
             {
                 long temp = list[i].Id;
                 this.departmentNode[temp].IsExpanded = true;
             }
             if (this.node != null)
             {
                 this.node.Bd.Visibility = Visibility.Collapsed;
             }
             this.node = this.staffNode[id];
             if (this.node != null)
             {
                 this.node.Focusable = true;
                 this.node.Focus();
                 this.node.Bd.Visibility = Visibility.Visible;
             }
         }
     }
 }
Exemplo n.º 9
0
 public void AddStaff(Staff staff)
 {
     try
     {
         if (staff != null)
         {
             System.Threading.Monitor.Enter(this.staffNode);
             if (!this.staffNode.ContainsKey(staff.Uid) && this.departmentNode.ContainsKey(staff.DepartmentId))
             {
                 MsgCenterTreeNode node = new MsgCenterTreeNode(staff, false);
                 node.SessionService = this.sessionService;
                 node.DataService = this.dataService;
                 if (!this.staffNode.ContainsKey(staff.Uid))
                 {
                     this.staffNode.Add(staff.Uid, node);
                     this.departmentNode[staff.DepartmentId].Items.Add(node);
                 }
             }
             System.Threading.Monitor.Exit(this.staffNode);
         }
     }
     catch (System.Exception ex)
     {
         System.Console.WriteLine(ex.ToString());
     }
 }
Exemplo n.º 10
0
 public void AddGroupList(System.Collections.Generic.List<GetIsMark> getIsMark)
 {
     try
     {
         this.GroupName.Items.Clear();
         this.GroupNode.Clear();
         for (int i = 0; i < getIsMark.Count; i++)
         {
             foreach (EntGroup gp in this.groups)
             {
                 if (gp.Gid == getIsMark[i].id)
                 {
                     this.group = gp;
                     break;
                 }
             }
             if (this.group != null)
             {
                 if (!this.GroupNode.ContainsKey(this.group.Gid))
                 {
                     MsgCenterTreeNode node = new MsgCenterTreeNode(this.group, true);
                     node.SessionService = this.sessionService;
                     node.DataService = this.dataService;
                     this.GroupNode.Add(this.group.Gid, node);
                     this.GroupName.Items.Add(node);
                 }
             }
             this.group = null;
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
Exemplo n.º 11
0
 private IDKin.IM.Core.Staff IsDepartStaff(MsgCenterTreeNode infom, long Departid)
 {
     IDKin.IM.Core.Staff staff = null;
     System.Collections.Generic.ICollection<MsgCenterTreeNode> stafflist = this.staffNode.Values;
     IDKin.IM.Core.Department Currentdepart = this.dataService.GetDepartment(Departid);
     IDKin.IM.Core.Staff result;
     foreach (MsgCenterTreeNode node in stafflist)
     {
         if (node.Staff.Uid == infom.Staff.Uid && node.Staff.DepartmentId == Departid)
         {
             staff = (result = node.Staff);
             return result;
         }
     }
     System.Collections.Generic.IList<long> id = new System.Collections.Generic.List<long>();
     this.GetClickdepart.Clear();
     id.Add(Departid);
     System.Collections.Generic.IList<IDKin.IM.Core.Department> depart = this.GetDepart(id, this.departlist);
     foreach (IDKin.IM.Core.Department dep in depart)
     {
         foreach (MsgCenterTreeNode node in stafflist)
         {
             if (node.Staff.Uid == infom.Staff.Uid && node.Staff.DepartmentId == dep.Id)
             {
                 staff = (result = node.Staff);
                 return result;
             }
         }
     }
     result = staff;
     return result;
 }
Exemplo n.º 12
0
 public void AddMarkList(System.Collections.Generic.List<GetIsMark> getIsMark)
 {
     try
     {
         this.staffNode.Clear();
         this.departmentNode.Clear();
         this.departlist.Clear();
         System.Collections.Generic.ICollection<IDKin.IM.Core.Staff> stafflist = this.dataService.GetStaffList();
         IDKin.IM.Core.Staff staff = null;
         for (int i = 0; i < getIsMark.Count; i++)
         {
             foreach (IDKin.IM.Core.Staff st in stafflist)
             {
                 if (st.Uid == getIsMark[i].id)
                 {
                     staff = st;
                     break;
                 }
             }
             if (staff != null)
             {
                 System.Threading.Monitor.Enter(this.staffNode);
                 if (!this.staffNode.ContainsKey(staff.Uid) && this.sessionService.Uid != staff.Uid)
                 {
                     MsgCenterTreeNode node = new MsgCenterTreeNode(staff, true);
                     node.SessionService = this.sessionService;
                     node.DataService = this.dataService;
                     if (!this.staffNode.ContainsKey(staff.Uid))
                     {
                         this.staffNode.Add(staff.Uid, node);
                         this.AddDepart(staff.Uid);
                         this.departmentNode[staff.DepartmentId].Items.Add(node);
                     }
                 }
                 System.Threading.Monitor.Exit(this.staffNode);
             }
             staff = null;
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }