Exemplo n.º 1
0
        /// <summary>
        /// 选择需要加入的人员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dg_GrouperList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            PP_PersonInfo tempPerson = dg_GrouperList.SelectedItem as PP_PersonInfo;

            if (tempPerson != null)
            {
                if (isMultSelect == true)
                {
                    personinfolist.Remove(tempPerson);
                    exsitUserIDList.Add(tempPerson.GUID);
                    SelectPersoninfolist.Add(tempPerson);

                    this.dg_SelectGrouperList.ItemsSource = null;
                    this.dg_SelectGrouperList.ItemsSource = SelectPersoninfolist;

                    this.dg_GrouperList.ItemsSource = null;
                    this.dg_GrouperList.ItemsSource = personinfolist;
                }
                else
                {
                    SelectPersoninfolist.Clear();
                    SelectPersoninfolist.Add(tempPerson);

                    this.dg_SelectGrouperList.ItemsSource = null;
                    this.dg_SelectGrouperList.ItemsSource = SelectPersoninfolist;
                }
            }
        }
        /// <summary>
        /// 复制保存当前的人员信息
        /// </summary>
        /// <param name="itemPersonList"></param>
        /// <returns></returns>
        private List <PP_PersonInfo> CopePersonList(List <PP_PersonInfo> list)
        {
            List <PP_PersonInfo> tempPersonList = new List <PP_PersonInfo>();

            foreach (PP_PersonInfo pinfo in list)
            {
                PP_PersonInfo npinfo = new PP_PersonInfo();

                npinfo.GUID        = pinfo.GUID;
                npinfo.ISCHECKED   = pinfo.ISCHECKED;
                npinfo.NAME        = pinfo.NAME;
                npinfo.ORG_GUID    = pinfo.ORG_GUID;
                npinfo.PERSON_TYPE = pinfo.PERSON_TYPE;
                npinfo.PHONE       = pinfo.PHONE;
                npinfo.PHOTO       = pinfo.PHOTO;
                npinfo.TASK        = pinfo.TASK;
                npinfo.UNIT        = pinfo.UNIT;
                npinfo.ADD_TYPE    = pinfo.ADD_TYPE;
                npinfo.DUTY        = pinfo.DUTY;
                tempPersonList.Add(npinfo);
            }


            return(tempPersonList);
        }
Exemplo n.º 3
0
        private PP_PersonInfo CreatePersonInfoSource(DeptMember dm)
        {
            PP_PersonInfo tempPersonInfo = new PP_PersonInfo();

            tempPersonInfo.GUID          = dm.UserID;
            tempPersonInfo.DISTRICT_CODE = dm.DistrictCode;

            tempPersonInfo.NAME = dm.RealName;
            tempPersonInfo.SEX  = dm.UserSex;
            tempPersonInfo.DUTY = dm.UserDuty;

            DistrictInfo rootDistrict = PT.Profile.Business.DistrictHelper.DistrictInfos.FindItemByCode(dm.DistrictCode);

            if (rootDistrict != null)
            {
                tempPersonInfo.UNIT = rootDistrict.Name + "无委";
            }

            tempPersonInfo.DEPT    = dm.DeptName;
            tempPersonInfo.DEPT_ID = dm.DeptID;
            //tempPersonInfo.TASK = dm.UserID;
            //tempPersonInfo.PERSON_TYPE = dm.UserID;
            tempPersonInfo.ADD_TYPE = 3;//选择加入

            try
            {
                var organizationChannel = PT_BS_Service.Client.Framework.BeOperationInvoker.GetInterface <PT.Profile.Interface.IOrganization>();
                var userInfo            = this.userInfoList.Find(item => item.UserID.Equals(dm.UserID));
                if (userInfo != null)
                {
                    tempPersonInfo.PHONE = userInfo.UserPhone;
                    tempPersonInfo.PHOTO = organizationChannel.GetUserPicture(dm.UserID);
                }


                //PT.Profile.Types.UserInfo ui = new PT.Profile.Types.UserInfo();

                //PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<PT.Profile.Interface.IOrganization, PT.Profile.Types.UserInfo>(p =>
                //{
                //    ui = p.GetUser(dm.UserID);
                //    return ui;
                //});

                //if (ui != null)
                //{
                //    tempPersonInfo.PHONE = ui.UserPhone;
                //    //tempPersonInfo.PHOTO = ui.UserPicture;
                //    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<PT.Profile.Interface.IOrganization>(p =>
                //    {
                //        tempPersonInfo.PHOTO = p.GetUserPicture(dm.UserID);

                //    });
                //}
            }
            catch
            { }

            return(tempPersonInfo);
        }
        /// <summary>
        /// 在查询结果人员数量不等于0的情况
        /// </summary>
        private void setDefaultImage()
        {
            PP_OrgInfo orgInfo = tv_PersonPlan.SelectedItem as PP_OrgInfo;

            if (orgInfo == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(orgInfo.PARENT_GUID) == true)
            {
                if (!itemPersonList.Where(item => item.PERSON_TYPE == 0).Any())
                {
                    PP_PersonInfo p0 = new PP_PersonInfo();
                    p0.GUID                    = CO_IA.Client.Utility.NewGuid();
                    p0.ORG_GUID                = orgInfo.GUID;
                    p0.ADD_TYPE                = 1;
                    p0.PERSON_TYPE             = 0;
                    grid_OrgLeader.DataContext = p0;
                    itemPersonList.Add(p0);
                }

                if (!itemPersonList.Where(item => item.PERSON_TYPE == 3).Any())
                {
                    PP_PersonInfo p3 = new PP_PersonInfo();
                    p3.GUID        = CO_IA.Client.Utility.NewGuid();
                    p3.ORG_GUID    = orgInfo.GUID;
                    p3.ADD_TYPE    = 1;
                    p3.PERSON_TYPE = 3;
                    grid_PSO_Coordinator.DataContext = p3;
                    itemPersonList.Add(p3);
                }
            }
            else
            {
                if (!itemPersonList.Where(item => item.PERSON_TYPE == 1).Any())
                {
                    PP_PersonInfo p1 = new PP_PersonInfo();
                    p1.GUID        = CO_IA.Client.Utility.NewGuid();
                    p1.ORG_GUID    = orgInfo.GUID;
                    p1.ADD_TYPE    = 1;
                    p1.PERSON_TYPE = 1;
                    grid_GroupLeaderImage.DataContext = p1;
                    itemPersonList.Add(p1);
                }
                if (!itemPersonList.Where(item => item.PERSON_TYPE == 2).Any())
                {
                    PP_PersonInfo p2 = new PP_PersonInfo();
                    p2.GUID        = CO_IA.Client.Utility.NewGuid();
                    p2.ORG_GUID    = orgInfo.GUID;
                    p2.ADD_TYPE    = 1;
                    p2.PERSON_TYPE = 2;
                    grid_SLeaderImage.DataContext = p2;
                    itemPersonList.Add(p2);
                }
            }
        }
Exemplo n.º 5
0
 public PersonPoint(PP_OrgInfo orgInfo, PP_PersonInfo personInfo)
 {
     InitializeComponent();
     OrgInfo    = orgInfo;
     PersonInfo = personInfo;
     if (personInfo != null)
     {
         ElementId          = MapGroupTypes.Person_.ToString() + PersonInfo.GUID;
         txtOrgname.Text    = OrgInfo.NAME;
         txtPersonname.Text = personInfo.NAME;
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 人员组织树进行切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tv_PersonPlan_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            try
            {
                //取得当前的被选择节点
                itemOrgInfo = ((System.Windows.Controls.TreeView)(sender)).SelectedItem as PP_DepartmentInfo;

                if (itemOrgInfo == null)
                {
                    return;
                }
                else
                {
                    //界面赋值

                    PT.Profile.Types.DeptMemberList deptList = new PT.Profile.Types.DeptMemberList();

                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <PT.Profile.Interface.IOrganization, PT.Profile.Types.DeptMemberList>(p =>
                    {
                        deptList = p.GetDeptMembersByDeptID(itemOrgInfo.GUID, false);

                        return(deptList);
                    });

                    personinfolist.Clear();

                    foreach (DeptMember dm in deptList)
                    {
                        if (dm.UserStatus == UserStatusEnum.Out ||
                            dm.UserStatus == UserStatusEnum.Forbid ||
                            dm.UserStatus == UserStatusEnum.Leave ||
                            dm.UserStatus == UserStatusEnum.Background ||
                            exsitUserIDList.Contains(dm.UserID))
                        {
                            continue;
                        }

                        PP_PersonInfo tempPersonInfo = CreatePersonInfoSource(dm);
                        personinfolist.Add(tempPersonInfo);
                    }


                    this.dg_GrouperList.ItemsSource = null;
                    this.dg_GrouperList.ItemsSource = personinfolist;
                }
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 7
0
        private void personlistbox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (personlistbox.SelectedItem == null)
            {
                return;
            }
            if (topAudio.Called)
            {
                return;
            }
            PP_PersonInfo person = personlistbox.SelectedItem as PP_PersonInfo;

            topAudio.PersonData = person;
        }
Exemplo n.º 8
0
        private Person_Info_Ext getPersonExt(PP_PersonInfo person)
        {
            Person_Info_Ext p = new Person_Info_Ext();

            p.GUID        = person.GUID;
            p.ISCHECKED   = person.ISCHECKED;
            p.NAME        = person.NAME;
            p.ORG_GUID    = person.ORG_GUID;
            p.PERSON_TYPE = person.PERSON_TYPE;
            p.PHONE       = person.PHONE;
            p.PHOTO       = person.PHOTO;
            p.TASK        = person.TASK;
            p.UNIT        = person.UNIT;
            p.ADD_TYPE    = person.ADD_TYPE;
            p.DUTY        = person.DUTY;
            p.Flag        = false;
            return(p);
        }
Exemplo n.º 9
0
        private void itemTrack_Click(object sender, RoutedEventArgs e)
        {
            MenuItem    item   = sender as MenuItem;
            ContextMenu menu   = item.Parent as ContextMenu;
            var         target = menu.PlacementTarget as PersonPoint;

            if (target != null)
            {
                PP_OrgInfo    orgInfo    = target.OrgInfo;
                PP_PersonInfo personInfo = target.PersonInfo;

                PersonPoint          group    = new PersonPoint(orgInfo, personInfo);
                Track.TrackCondition conTrack = new Track.TrackCondition(group);
                conTrack.VehicleNum = personInfo.GUID;
                conTrack.Owner      = VisualTreeHelperExtension.GetParentObject <System.Windows.Window>(Element);
                conTrack.Show();
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 取消需要加入的人员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dg_SelectGrouperList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            PP_PersonInfo tempPerson = this.dg_SelectGrouperList.SelectedItem as PP_PersonInfo;

            if (tempPerson != null)
            {
                exsitUserIDList.Remove(tempPerson.GUID);
                SelectPersoninfolist.Remove(tempPerson);
                this.dg_SelectGrouperList.ItemsSource = null;
                this.dg_SelectGrouperList.ItemsSource = SelectPersoninfolist;

                if (tempPerson.DEPT_ID == itemOrgInfo.GUID)
                {
                    personinfolist.Add(tempPerson);
                    this.dg_GrouperList.ItemsSource = null;
                    this.dg_GrouperList.ItemsSource = personinfolist;
                }
            }
        }
Exemplo n.º 11
0
        public PP_GrouperUC(PP_PersonInfo personInfo, bool isShow = true)
        {
            InitializeComponent();

            PersonInfoData = personInfo;

            if (isShow == false)
            {
                this.cb_PersonName.Visibility = System.Windows.Visibility.Hidden;
                this.tb_PersonName.Visibility = System.Windows.Visibility.Visible;
            }
            this.cb_PersonName.Content = PersonInfoData.NAME;
            this.tb_PersonName.Text    = PersonInfoData.NAME;

            if (PersonInfoData.PHOTO != null)
            {
                try
                {
                    #region read the image from a bytes array

                    System.IO.MemoryStream ms = new System.IO.MemoryStream(PersonInfoData.PHOTO);//imageData是从数据库中读取出来的字节数组

                    ms.Seek(0, System.IO.SeekOrigin.Begin);

                    BitmapImage newBitmapImage = new BitmapImage();

                    newBitmapImage.BeginInit();

                    newBitmapImage.StreamSource = ms;

                    newBitmapImage.EndInit();

                    this.img_PersonImage.Source = newBitmapImage;

                    #endregion
                }
                catch
                {
                }
            }
        }
        public PersonDetailInfoDialog(PP_PersonInfo personinfo)
        {
            InitializeComponent();
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;


            PersonInfoData = personinfo;
            mode           = 1;//修改

            tb_Name.Text  = personinfo.NAME;
            tb_Unit.Text  = personinfo.UNIT;
            tb_Duty.Text  = personinfo.DUTY;
            tb_Phone.Text = personinfo.PHONE;

            if (personinfo.PHOTO != null)
            {
                try
                {
                    #region read the image from a bytes array

                    System.IO.MemoryStream ms = new System.IO.MemoryStream(personinfo.PHOTO);//imageData是从数据库中读取出来的字节数组

                    ms.Seek(0, System.IO.SeekOrigin.Begin);

                    BitmapImage newBitmapImage = new BitmapImage();

                    newBitmapImage.BeginInit();

                    newBitmapImage.StreamSource = ms;

                    newBitmapImage.EndInit();

                    this.img_PersonImage.Source = newBitmapImage;

                    #endregion
                }
                catch
                {
                }
            }
        }
        void cb_PersonName_Click(object sender, RoutedEventArgs e)
        {
            int i = 0;

            foreach (UIElement element in wp_GrouperListr.Children)
            {
                try
                {
                    if (((PP_GrouperUC)element).cb_PersonName.IsChecked == true)
                    {
                        i++;
                    }

                    PP_PersonInfo tempInfo = ((PP_GrouperUC)element).Tag as PP_PersonInfo;

                    tempInfo.ISCHECKED = (bool)((PP_GrouperUC)element).cb_PersonName.IsChecked;
                }

                catch
                { }
            }
        }
        /// <summary>
        /// 根据组织结构信息读取该组织详细信息
        /// </summary>
        /// <param name="selectOrgInfo"></param>
        private void SetOrgInfoDetails(PP_OrgInfo selectOrgInfo)
        {
            //清除历史节点保留信息
            ClearHistoryItemInfos();

            if (selectOrgInfo != null)
            {
                //取得当前节点的数据
                itemOrgInfo = selectOrgInfo;

                PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.PersonSchedule.I_CO_IA_PersonSchedule>(channel =>
                {
                    //更新当前节点
                    itemPersonList = channel.GetPP_PersonInfos(selectOrgInfo.GUID);
                });

                if (itemPersonList.Count == 0)
                {
                    if (string.IsNullOrEmpty(selectOrgInfo.PARENT_GUID) == true)
                    {
                        PP_PersonInfo p0 = new PP_PersonInfo();
                        p0.GUID        = CO_IA.Client.Utility.NewGuid();
                        p0.ORG_GUID    = selectOrgInfo.GUID;
                        p0.ADD_TYPE    = 1;
                        p0.PERSON_TYPE = 0;

                        itemPersonList.Add(p0);

                        PP_PersonInfo p3 = new PP_PersonInfo();
                        p3.GUID        = CO_IA.Client.Utility.NewGuid();
                        p3.ORG_GUID    = selectOrgInfo.GUID;
                        p3.ADD_TYPE    = 1;
                        p3.PERSON_TYPE = 3;
                        itemPersonList.Add(p3);
                    }
                    else
                    {
                        PP_PersonInfo p1 = new PP_PersonInfo();

                        p1.GUID        = CO_IA.Client.Utility.NewGuid();
                        p1.ORG_GUID    = selectOrgInfo.GUID;
                        p1.ADD_TYPE    = 1;
                        p1.PERSON_TYPE = 1;

                        itemPersonList.Add(p1);


                        PP_PersonInfo p2 = new PP_PersonInfo();
                        p2.GUID        = CO_IA.Client.Utility.NewGuid();
                        p2.ORG_GUID    = selectOrgInfo.GUID;
                        p2.ADD_TYPE    = 1;
                        p2.PERSON_TYPE = 2;
                        itemPersonList.Add(p2);
                    }
                }
                else
                {
                    setDefaultImage();
                }

                grid_OrgLeaderHeader.DataContext = null;
                grid_OrgLeaderHeader.DataContext = selectOrgInfo;
                //根节点
                if (selectOrgInfo.PARENT_GUID == "")
                {
                    grid_OrgLeader.Visibility = System.Windows.Visibility.Visible;
                    tab_equ.Visibility        = System.Windows.Visibility.Collapsed;

                    grid_EquipList.Visibility   = System.Windows.Visibility.Hidden;
                    grid_GroupLeader.Visibility = System.Windows.Visibility.Hidden;

                    //便利人员列表并赋值人员类型:0.主任 1.组长;2.副组长3.协调裕安。4.组员
                    foreach (PP_PersonInfo tempPersonInfo in itemPersonList)
                    {
                        if (tempPersonInfo.PERSON_TYPE == 4)
                        {
                            itemGrouperList.Add(tempPersonInfo);
                        }
                        else if (tempPersonInfo.PERSON_TYPE == 0)
                        {
                            grid_OrgLeader.DataContext = null;
                            grid_OrgLeader.DataContext = tempPersonInfo;
                        }
                        else if (tempPersonInfo.PERSON_TYPE == 3)
                        {
                            grid_PSO_Coordinator.DataContext = null;
                            grid_PSO_Coordinator.DataContext = tempPersonInfo;
                        }
                    }
                }
                //其他组织节点
                else
                {
                    grid_OrgLeader.Visibility = System.Windows.Visibility.Hidden;
                    tab_equ.Visibility        = System.Windows.Visibility.Visible;

                    grid_EquipList.Visibility   = System.Windows.Visibility.Visible;
                    grid_GroupLeader.Visibility = System.Windows.Visibility.Visible;


                    //便利人员列表并赋值人员类型:0.主任 1.组长;2.副组长3.协调裕安。4.组员
                    foreach (PP_PersonInfo tempPersonInfo in itemPersonList)
                    {
                        if (tempPersonInfo.PERSON_TYPE == 4)
                        {
                            itemGrouperList.Add(tempPersonInfo);
                        }
                        else if (tempPersonInfo.PERSON_TYPE == 1)
                        {
                            grid_GroupLeaderDetail.DataContext = null;
                            grid_GroupLeaderDetail.DataContext = tempPersonInfo;


                            grid_GroupLeaderImage.DataContext = null;
                            grid_GroupLeaderImage.DataContext = tempPersonInfo;
                        }
                        else if (tempPersonInfo.PERSON_TYPE == 2)
                        {
                            grid_SLeaderInfo.DataContext = null;
                            grid_SLeaderInfo.DataContext = tempPersonInfo;

                            grid_SLeaderImage.DataContext = null;
                            grid_SLeaderImage.DataContext = tempPersonInfo;
                        }
                    }

                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.PersonSchedule.I_CO_IA_PersonSchedule>(channel =>
                    {
                        //更新当前节点
                        itemEquipList = channel.GetPP_EqupInfos(selectOrgInfo.GUID);
                    });

                    dataGridMonitorEquipment.ItemsSource = itemEquipList;
                }

                //职责区域
                if (itemOrgInfo != null)
                {
                    if (!string.IsNullOrEmpty(itemOrgInfo.DUTY))
                    {
                        string[] dutys = itemOrgInfo.DUTY.Split(',');
                        for (int i = 0; i < dutys.Length; i++)
                        {
                            foreach (var ele in wp_dutylist.Children)
                            {
                                CheckBox chk = ele as CheckBox;
                                if (chk != null)
                                {
                                    if (chk.Tag.ToString() == dutys[i])
                                    {
                                        chk.IsChecked = true;
                                    }
                                }
                            }
                        }
                    }
                }
                //填充人员显示列表
                FillGrouperWrapPanel(itemGrouperList);

                #region 如果所有人员都没有照片就显示列表
                try
                {
                    bool isGourperHasImage = false;

                    foreach (PP_PersonInfo pinfo in this.itemGrouperList)
                    {
                        if (pinfo.PHOTO != null && pinfo.PHOTO.Length > 1)
                        {
                            isGourperHasImage = true;
                            break;
                        }
                    }

                    if (isGourperHasImage == false)
                    {
                        cb_Grouper.IsChecked      = true;
                        dg_GrouperList.Visibility = System.Windows.Visibility.Visible;

                        sv_Grouper.Visibility = System.Windows.Visibility.Hidden;
                    }
                    else
                    {
                        cb_Grouper.IsChecked      = false;
                        dg_GrouperList.Visibility = System.Windows.Visibility.Hidden;

                        sv_Grouper.Visibility = System.Windows.Visibility.Visible;
                    }
                }
                catch
                { }
                #endregion

                PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.PersonSchedule.I_CO_IA_PersonSchedule>(channel =>
                {
                    //更新当前节点
                    itemVehicle = channel.GetPP_VehicleInfo(selectOrgInfo.GUID);
                });

                if (itemVehicle == null || itemVehicle.GUID == null)
                {
                    itemVehicle              = new PP_VehicleInfo();
                    itemVehicle.GUID         = CO_IA.Client.Utility.NewGuid();
                    itemVehicle.ORG_GUID     = selectOrgInfo.GUID;
                    itemVehicle.ADD_TYPE     = 1;
                    itemVehicle.VEHICLE_TYPE = -1;
                }


                this.gird_VehicleInfo.DataContext = null;
                this.gird_VehicleInfo.DataContext = itemVehicle;

                #region  保存比对信息

                //保存组织信息
                itemOrgInfoForComp = CopeOrgInfo(itemOrgInfo);

                // 复制保存当前的人员信息
                itemPersonListForComp = CopePersonList(itemPersonList);

                // 复制保存当前的设备信息
                itemEquipListForComp = CopeEquipList(itemEquipList);

                // 复制保存当前的设备信息
                itemVehicleForComp = CopeVehicleInfo(itemVehicle);

                #endregion
            }
        }