Пример #1
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);
 }
        private void AddSendFileHandle(string[] fileArray)
        {
            if (fileArray != null && fileArray.Length > 0)
            {
                int i = 0;
                while (i < fileArray.Length)
                {
                    string             filePath = fileArray[i];
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
                    if (ValidationUtil.IsSharePath(fileInfo.FullName))
                    {
                        this.ChatComponent.AddMessageNotice("目前暂时不支持发送共享文件!");
                    }
                    else
                    {
                        if (this.staff == null)
                        {
                            break;
                        }
                        if (this.sessionService.DeptBlockList.Contains(this.staff.DepartmentId))
                        {
                            IDKin.IM.Core.Department dep = this.dataService.GetDepartment(this.staff.DepartmentId);
                            string depname = (dep == null) ? string.Empty : dep.Name;
                            this.ChatComponent.AddMessageNotice(string.Concat(new string[]
                            {
                                "您没有权限向\"",
                                depname,
                                "\"发送文件,\"",
                                fileInfo.Name,
                                "\"发送失败"
                            }));
                        }
                        else
                        {
                            if (fileInfo.Length / 10L <= 209715200L)
                            {
                                if (fileInfo.Length == 0L)
                                {
                                    this.ChatComponent.AddMessageNotice("您发的文件" + fileInfo.Name + "内容为0KB, 发送失败");
                                }
                                else
                                {
                                    this.AddSendFileItem(fileInfo);
                                }
                            }
                            else
                            {
                                this.ChatComponent.AddMessageNotice("您发的文件" + fileInfo.Name + "已经超过最大容量2G, 发送失败");
                            }
                        }
                    }
IL_193:
                    i++;
                    continue;
                    goto IL_193;
                }
            }
        }
Пример #3
0
 private void DepartTreeView_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     try
     {
         TreeViewItem tvi = base.SelectedItem as TreeViewItem;
         if (tvi != null)
         {
             IDKin.IM.Core.Department department = tvi.DataContext as IDKin.IM.Core.Department;
             if (department != null)
             {
                 WindowModel.Instance.Markpage.markedList.Items.Clear();
                 if (department != null)
                 {
                     System.Collections.Generic.List <IDKin.IM.Core.Staff>      addstafflist = new System.Collections.Generic.List <IDKin.IM.Core.Staff>();
                     System.Collections.Generic.ICollection <MsgCenterTreeNode> getstafflist = this.staffNode.Values;
                     foreach (MsgCenterTreeNode node in getstafflist)
                     {
                         IDKin.IM.Core.Staff staff = this.IsDepartStaff(node, department.Id);
                         if (staff != null)
                         {
                             addstafflist.Add(staff);
                         }
                     }
                     if (addstafflist.Count > 0)
                     {
                         WindowModel.Instance.Markpage.ShowDepartList(addstafflist);
                     }
                 }
                 WindowModel.Instance.MessageCenterWindow.ViewMsgFrame.NavigationService.Navigate(WindowModel.Instance.Markpage);
                 this.departmentNode[department.Id].IsExpanded = !this.departmentNode[department.Id].IsExpanded;
             }
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
Пример #4
0
 private System.Collections.Generic.List <IDKin.IM.Core.Department> GetDepart(long id)
 {
     System.Collections.Generic.List <IDKin.IM.Core.Department>        listdepart = new System.Collections.Generic.List <IDKin.IM.Core.Department>();
     System.Collections.Generic.ICollection <IDKin.IM.Core.Department> Departs    = this.dataService.GetDepartmentList();
     IDKin.IM.Core.Staff staff = this.dataService.GetStaff(id);
     if (staff != null)
     {
         IDKin.IM.Core.Department temp = this.dataService.GetDepartment(staff.DepartmentId);
         if (temp != null)
         {
             listdepart.Add(temp);
             while (temp != null)
             {
                 temp = this.dataService.GetDepartment(temp.Pid);
                 if (temp != null)
                 {
                     listdepart.Add(temp);
                 }
             }
         }
     }
     return(listdepart);
 }
Пример #5
0
 public void DepartmentListEventHandle(System.Collections.ObjectModel.Collection<DepartmentResponse> list)
 {
     try
     {
         if (list != null)
         {
             foreach (DepartmentResponse response in list)
             {
                 if (response != null)
                 {
                     IDKin.IM.Core.Department department = new IDKin.IM.Core.Department();
                     department.Id = response.id;
                     department.Description = response.description;
                     department.Name = response.name;
                     department.Pid = response.pid;
                     department.Uid = response.uid;
                     this.dataService.AddDepartment(department);
                     this.GetStaffList(department.Id);
                     if (department.Id == this.sessionService.DepartmentId)
                     {
                         this.sessionService.DepartmentName = department.Name;
                         this.inWindow.InitSelfDepartment();
                     }
                 }
             }
             this.ShowDepartment();
         }
     }
     catch (System.Exception e)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
 }