internal void LoadActivity(CO_IA.Data.Activity activity)
        {
            if (!Utility.HasActivityManageRight())
            {
                this.buttonPlanDatabase.Visibility = System.Windows.Visibility.Collapsed;
                this.buttonSetting.Visibility      = System.Windows.Visibility.Collapsed;
                this.buttonTemplate.Visibility     = System.Windows.Visibility.Collapsed;
            }
            if (this.Activity == null)
            {
                this.stackPanelFunction.Visibility = System.Windows.Visibility.Visible;

                activity.ActivityStage = ActivityStage.Execute;
                this.Activity          = activity;
                this.DataContext       = activity;
                //this.textBlockActivityName.Text = this.Activity.Name;
                //this.documentActivityInfo.Content = new CO_IA.UI.ActivityManage.ActivityManageModule();

                //CreateAndSaveDefaultOrgInfos(activity);

                //this.layoutRoot.DataContext = new EmployeesViewModel();


                return;
            }
            throw new Exception("已存在打开的活动,不能重新打开");
        }
Esempio n. 2
0
        /// <summary>
        /// 加载活动
        /// </summary>
        /// <param name="activity"></param>
        public void LoadActivity(CO_IA.Data.Activity activity)
        {
            SystemLoginService.CurrentActivity = activity;
            SetNetLinkState(SystemLoginService.IsLogin);
            _activityName.Text = activity.Name;
            List <ActivityPlace> placeList = SQLiteDataService.QueryPlaceByActivityGuid(activity.Name, activity.Guid);

            if (placeList.Count == 0)
            {
                _layerMask.Visibility         = System.Windows.Visibility.Visible;
                xCollect.Visibility           = System.Windows.Visibility.Collapsed;
                xAppButtonAnalysis.Visibility = System.Windows.Visibility.Collapsed;
                xDataUpload.Visibility        = System.Windows.Visibility.Collapsed;
                _noPlaceTooltip.Text          = "没有找到活动区域,请在保持联网的状态下,下载最新活动区域数据后,再重新启动系统";
                return;
            }
            else
            {
                _layerMask.Visibility         = System.Windows.Visibility.Collapsed;
                xCollect.Visibility           = System.Windows.Visibility.Visible;
                xAppButtonAnalysis.Visibility = System.Windows.Visibility.Visible;
                if (SystemLoginService.IsLogin == true)
                {
                    xDataUpload.Visibility = System.Windows.Visibility.Visible;
                }
                _noPlaceTooltip.Text = "";
            }

            LoadAreaCbox(placeList);
        }
        /// <summary>
        /// 创建默认的组织结构组
        /// </summary>
        private void CreateAndSaveDefaultOrgInfos(CO_IA.Data.Activity activity)
        {
            //重大活动安全保障办公室
            string rootGUID = CO_IA.Client.Utility.NewGuid();

            //频率台站第一小组
            string pinlvSubGUID1 = CO_IA.Client.Utility.NewGuid();
            //频率台站第二小组
            string pinlvSubGUID2 = CO_IA.Client.Utility.NewGuid();
            //监测组第一小组
            string jianceSubGUID1 = CO_IA.Client.Utility.NewGuid();
            //监测组第二小组
            string jianceSubGUID2 = CO_IA.Client.Utility.NewGuid();

            List <PP_OrgInfo> nodes = new List <PP_OrgInfo>()
            {
                new PP_OrgInfo {
                    GUID = rootGUID, ACTIVITY_GUID = activity.Guid, NAME = "油料股", DUTY = "01"
                },
                new PP_OrgInfo {
                    GUID = jianceSubGUID1, ACTIVITY_GUID = activity.Guid, NAME = "干部", PARENT_GUID = rootGUID, DUTY = "02"
                },
                new PP_OrgInfo {
                    GUID = jianceSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "高级士官", PARENT_GUID = rootGUID, DUTY = "03"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID1, ACTIVITY_GUID = activity.Guid, NAME = "四级军士长", PARENT_GUID = rootGUID, DUTY = "04"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "上士", PARENT_GUID = rootGUID, DUTY = "05"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "中士", PARENT_GUID = rootGUID, DUTY = "06"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "下士", PARENT_GUID = rootGUID, DUTY = "07"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "上等兵", PARENT_GUID = rootGUID, DUTY = "08"
                },
                new PP_OrgInfo {
                    GUID = pinlvSubGUID2, ACTIVITY_GUID = activity.Guid, NAME = "新兵", PARENT_GUID = rootGUID, DUTY = "09"
                },
            };



            tv_PersonPlan.Items.Clear();//加载根节点前先清除Treeview控件项

            //PP_OrgInfo node = new PP_OrgInfo { GUID = rootGUID, ACTIVITY_GUID = activity.Guid, NAME = "重大活动安全保障办公室" };

            ForeachPropertyNode(nodes[0], nodes[0].GUID, nodes);
            itemList.Add(nodes[0]);

            this.tv_PersonPlan.ItemsSource = null;
            this.tv_PersonPlan.ItemsSource = itemList;
        }
        internal void LoadActivity(CO_IA.Data.Activity activity)
        {
            if (!Utility.HasActivityManageRight())
            {
                this.buttonPlanDatabase.Visibility = System.Windows.Visibility.Collapsed;
                this.buttonSetting.Visibility      = System.Windows.Visibility.Collapsed;
                this.buttonTemplate.Visibility     = System.Windows.Visibility.Collapsed;
            }
            if (this.Activity == null)
            {
                this.stackPanelFunction.Visibility = System.Windows.Visibility.Visible;

                activity.ActivityStage = ActivityStage.Execute;
                this.Activity          = activity;
                this.DataContext       = activity;


                return;
            }
            throw new Exception("已存在打开的活动,不能重新打开");
        }
Esempio n. 5
0
        public void LoadActivityPlace(CO_IA.Data.Activity activity, ActivityPlace place, PP_OrgInfo orgInfo)
        {
            //RiasPortal.UpdateUserRights(orgInfo);
            //RiasPortal.DutyList.Clear();
            //if (orgInfo != null && !string.IsNullOrWhiteSpace(orgInfo.DUTY))
            //{
            //    RiasPortal.DutyList.AddRange(orgInfo.DUTY.Split(','));
            //}

            this.executorLognInfo.LoginOrg = orgInfo;
            //this.executorLognInfo.LoginPlace = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.ActivityManage.I_CO_IA_ActivityManage, ActivityPlaceInfo>(channel =>
            //    {
            //        return channel.GetPlaceInfo(place.Guid);
            //    });
            this.Activity = activity;
            //SystemLoginService.CurrentActivity = activity;
            //SystemLoginService.CurrentActivityPlace = place;
            _activityName.Text        = activity.Name;
            this.textBlockPlace.Text  = place.Name;
            textBlockPersonGroup.Text = orgInfo.NAME;
            //LoadUserGroupInfo();
            //SetMenuDisplayState();
            //try
            //{
            //    int servicePort = CO_IA.Client.Utility.StartMessageService(port =>
            //        {
            //            PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.MessageCenter.I_CO_IA_MessageCenter>
            //            (channel =>
            //            {
            //                channel.RegisterSceneClient(port, this.Activity.Guid, this.executorLognInfo.LoginOrg.GUID, this.executorLognInfo.LoginPlace.Guid);
            //            });
            //        });
            //    CO_IA.Client.Utility.RegisterMessageReceiver(this);
            //    //PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.MessageCenter.I_CO_IA_MessageCenter>
            //    //(channel =>
            //    //{
            //    //    channel.RegisterSceneClient(servicePort, this.Activity.Guid, this.executorLognInfo.LoginOrg.GUID, this.executorLognInfo.LoginPlace.Guid);
            //    //});
            //}
            //catch (System.Exception ex)
            //{
            //    MessageBox.Show(this, ex.Message, "启动消息接收服务错误");
            //}
            //try
            //{
            //    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_PersonSchedule>(
            //        channel =>
            //        {
            //            var vehicle = channel.GetPP_VehicleInfo(this.executorLognInfo.LoginOrg.GUID);
            //            if (vehicle != null && !string.IsNullOrWhiteSpace(vehicle.GUID))
            //            {
            //                this.vehicleInfo = vehicle;
            //                this.checkBoxGps.Visibility = System.Windows.Visibility.Visible;
            //            }
            //        });
            //}
            //catch (System.Exception e)
            //{
            //    MessageBox.Show(this, e.Message, "读取车辆信息失败");
            //}
            //xFreqAppButton.IsChecked = true;
            this.xTaskAppButton.IsChecked = true;
        }