Пример #1
0
        public async Task <IActionResult> PutActivityPlace([FromRoute] long id, [FromBody] ActivityPlace activityPlace)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != activityPlace.placdeId)
            {
                return(BadRequest());
            }

            _context.Entry(activityPlace).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ActivityPlaceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        private void AreaCBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            ComboBox     CboxEdit = sender as ComboBox;
            ComboBoxItem item     = CboxEdit.SelectedItem as ComboBoxItem;

            if (item == null)
            {
                return;
            }
            ActivityPlace place = item.DataContext as ActivityPlace;

            if (AreaChanged != null && !string.IsNullOrEmpty(SystemLoginService.CurrentActivityPlace.Guid) && place.Guid != SystemLoginService.CurrentActivityPlace.Guid)
            {
                if (MessageBox.Show("如果更改当前监测区域,当前界面数据将会被丢弃,\r\n 系统将重新加载新页面,是否继续更改当前区域", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    SystemLoginService.CurrentActivityPlace = item.DataContext as ActivityPlace;
                    AreaChanged(SystemLoginService.CurrentActivity, SystemLoginService.CurrentActivityPlace);
                }
                else
                {
                    SetAreaCboxSelectedItem();
                    return;
                }
            }
        }
Пример #3
0
        private void ListBoxItem_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                ListBoxItem item = e.Source as ListBoxItem;
                if (item != null && item.DataContext is ActivityPlace)
                {
                    ActivityPlace place   = item.DataContext as ActivityPlace;
                    var           listBox = VisualTreeHelperExtension.GetParentObject <ListBox>(item);
                    if (listBox != null && place != null)
                    {
                        ActivityExt activity = listBox.DataContext as ActivityExt;
                        var         userInfo = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_PersonSchedule, PP_OrgInfo>(channel =>
                        {
                            return(channel.GetPP_OrgInfoByPersonID(RiasPortal.Current.UserSetting.UserID, activity.Guid));
                        });
                        if (userInfo != null && !string.IsNullOrEmpty(userInfo.GUID))
                        {
                            //SystemLoginService.UserOrgInfo = userInfo;
                            //SystemLoginService.CurrentActivity = activity;
                            //SystemLoginService.CurrentActivityPlace = place;

                            this.OpenActivityPlace(activity, place, userInfo);
                        }
                        else
                        {
                            MessageBox.Show("无法打开活动,未能加载当前用户在该活动中的信息");
                        }
                    }
                }
            }
        }
Пример #4
0
 public MainWindow(ActivityPlace p_activityPlace, Action <Activity, ActivityPlace> p_areaChanged)
 {
     InitializeComponent();
     this._currentPlace = p_activityPlace;
     this.AreaChanged   = p_areaChanged;
     SystemLoginService.SynTypes.Add(typeof(CO_IA.UI.Collection.LoginService));
     this.Loaded += MainWindow_Loaded;
 }
Пример #5
0
 private void OpenActivityPlace(Activity activity, ActivityPlace place, PP_OrgInfo orgInfo)
 {
     if (this.InvokeActivityPlace != null)
     {
         this.InvokeActivityPlace(activity, place, orgInfo);
         this.Close();
     }
 }
Пример #6
0
        public async Task <IActionResult> PostActivityPlace([FromBody] ActivityPlace activityPlace)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.ActivityPlace.Add(activityPlace);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetActivityPlace", new { id = activityPlace.placdeId }, activityPlace));
        }
Пример #7
0
        private void xComboboxSite_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
            {
                return;
            }
            ActivityPlace place = e.AddedItems[0] as ActivityPlace;

            if (place == null)
            {
                return;
            }
            _mapLoadControl.LoadActivityPlace = (CO_IA.Data.ActivityPlaceInfo)xComboboxSite.SelectedItem;
            var stepState = this.listBoxFreqPlanningStep.SelectedValue as FreqPlanningStepState;

            PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.ActivityManage.I_CO_IA_ActivityManage>(p =>
            {
                var stepStates = p.GetStepStates(CO_IA.Client.RiasPortal.ModuleContainer.Activity.Guid, place.Guid);
                stepStates     = (from step in stepStates where disposalSteps.Contains(step.Step) select step).OrderBy(step => step.Order).ToArray();

                this.listBoxFreqPlanningStep.ItemsSource = null;
                this.listBoxFreqPlanningStep.ItemsSource = stepStates;
                //this.listBoxFreqPlanningStep.SelectedIndex = -1;
                if (stepState != null)
                {
                    foreach (var state in stepStates)
                    {
                        if (state.Step == stepState.Step)
                        {
                            this.listBoxFreqPlanningStep.SelectedValue = state;
                            return;
                        }
                    }
                }
                if (stepStates.Length > 0)
                {
                    this.listBoxFreqPlanningStep.SelectedIndex = 0;
                    return;
                }
                this.listBoxFreqPlanningStep.SelectedIndex = -1;
            });
        }
Пример #8
0
 private void SetAreaCboxSelectedItem()
 {
     if (_currentPlace != null && !string.IsNullOrEmpty(_currentPlace.Guid))
     {
         for (int i = 0; i < _areaCBox.Items.Count; i++)
         {
             if ((_areaCBox.Items[i] as ComboBoxItem).Tag.ToString() == _currentPlace.Guid)
             {
                 _areaCBox.UpdateLayout();
                 _areaCBox.SelectedIndex = i;
             }
         }
     }
     else
     {
         if (_areaCBox.Items.Count > 0)
         {
             (_areaCBox.Items[0] as ComboBoxItem).IsSelected = true;
             SystemLoginService.CurrentActivityPlace         = (_areaCBox.Items[0] as ComboBoxItem).DataContext as ActivityPlace;
             _currentPlace = SystemLoginService.CurrentActivityPlace;
         }
     }
 }
Пример #9
0
        /// <summary>
        /// 实时监测控件
        /// </summary>
        /// <param name="pFreqPlanList">匹配频率列表</param>
        /// <param name="pRoundStationList">周围台站列表</param>
        /// <param name="AfterMonitor">保存数据回调</param>
        /// <param name="activity">活动</param>
        /// <param name="place">地点</param>
        public RealTimeMonitor(DetailMonitorPlan p_monitorPlan, List <FreqPlanActivity> pFreqPlanList, List <RoundStationInfo> pRoundStationList, Action <List <Data.Collection.AnalysisResult>, List <Data.Collection.AnalysisResult>, List <Data.Collection.AnalysisResult> > AfterMonitor = null, Activity activity = null, ActivityPlace place = null)
        {
            InitializeComponent();

            _plan      = p_monitorPlan;
            _viewmodel = Resources["Locator"] as ViewModelLocator;

            //_cv = new ChartView();
            //_cv.DataContext = _viewmodel.FreqDataCollect.LineChartViewModel;
            //nmb.Children.Add(_cv);

            _pfreqPlanList = pFreqPlanList;
            if (_viewmodel != null && _viewmodel.FreqDataCollect != null)
            {
                _viewmodel.FreqDataCollect.AfterMonitor        += AfterMonitor;
                _viewmodel.FreqDataCollect.RoundStationInfoList = pRoundStationList;
                _viewmodel.FreqDataCollect.MonitorPlan          = _plan;

                if (activity != null)
                {
                    _viewmodel.FreqDataCollect.Activity = activity;
                }
                if (place != null)
                {
                    _viewmodel.FreqDataCollect.Place = place;
                }
            }

            initListBoxData();
            DispatcherHelper.Initialize();
            img_burst_signal.Opacity = 0.5;
            ctrlImageflick();
            linkAgilentEquipment();
        }
Пример #10
0
 /// <summary>
 /// 现场端
 /// </summary>
 /// <param name="p_activity"></param>
 /// <param name="p_place"></param>
 public FreqPlanModule(Activity p_activity, ActivityPlace p_place)
 {
     InitializeComponent();
 }
Пример #11
0
        /// <summary>
        /// 实时监测控件
        /// </summary>
        /// <param name="pFreqPlanList">匹配频率列表</param>
        /// <param name="pRoundStationList">周围台站列表</param>
        /// <param name="AfterMonitor">保存数据回调</param>
        /// <param name="activity">活动</param>
        /// <param name="place">地点</param>
        //add by michael
        public RealTimeMonitorNew(string p_monitorPlanID, List <MonitorPlanInfo> pFreqPlanList, List <ActivityEquipment> pEquipmentList, List <ActivitySurroundStation> pRoundStationList, Action <List <Data.Collection.AnalysisResult>, List <Data.Collection.AnalysisResult>, List <Data.Collection.AnalysisResult> > AfterMonitor = null, Activity activity = null, ActivityPlace place = null)
        {
            InitializeComponent();

            //_plan = p_monitorPlan;
            _viewmodel = Resources["Locator"] as ViewModelLocator;

            //_cv = new ChartView();
            //_cv.DataContext = _viewmodel.FreqDataCollect.LineChartViewModel;
            //nmb.Children.Add(_cv);

            _pfreqPlanList = pFreqPlanList;
            if (_viewmodel != null && _viewmodel.FreqDataCollectNew != null)
            {
                MonitorData = AfterMonitor;
                //realTimeMonitor_MonitorData
                _viewmodel.FreqDataCollectNew.AfterMonitor += realTimeMonitor_MonitorData;
                //_viewmodel.FreqDataCollectNew.AfterMonitor += AfterMonitor;
                _viewmodel.FreqDataCollectNew.RoundStationInfoList = pRoundStationList;
                _viewmodel.FreqDataCollectNew.EquipmentList        = pEquipmentList;
                _viewmodel.FreqDataCollectNew.MonitorPlanID        = p_monitorPlanID;//add by michael
                if (pFreqPlanList != null && pFreqPlanList.Count > 0)
                {
                    var fps = pFreqPlanList[0];
                    _viewmodel.FreqDataCollectNew.FPS = fps;
                    if (!(fps.kHzBand > 0))
                    {
                        fps.kHzBand = 12.5;
                    }
                    spin_start.Text     = fps.MHzFreqFrom.ToString();
                    spin_stop.Text      = fps.MHzFreqTo.ToString();
                    spin_bandWidth.Text = fps.kHzBand.ToString();
                }


                if (activity != null)
                {
                    _viewmodel.FreqDataCollectNew.Activity = activity;
                }
                if (place != null)
                {
                    _viewmodel.FreqDataCollectNew.Place = place;
                }
            }
            foreach (var item in _pfreqPlanList)
            {
                var info = new FreqRangeMonitorInfo();
                info.FreqRangeName       = item.MHzFreqFrom + "-" + item.MHzFreqTo;
                info.MHzFreqFrom         = item.MHzFreqFrom;
                info.MHzFreqTo           = item.MHzFreqTo;
                info.IllegalFreqInfoList = new ObservableCollection <IllegalFreqInfo>();
                info.LegalFreqInfoList   = new ObservableCollection <LegalFreqInfo>();
                FreqRangeMonitorInfoList.Add(info);
            }
            tabControl.ItemsSource = FreqRangeMonitorInfoList;
            initListBoxData();


            DispatcherHelper.Initialize();
            img_burst_signal.Opacity = 0.5;
            //ctrlImageflick();
            //linkAgilentEquipment();
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Register <string>(this, "ShowMyMessage", OnShowMessage);//add by michael
        }
 public ExtractFromEquipmentDBDialog(ActivityPlace activityPlaceInfo)
 {
     InitializeComponent();
     this.Loaded           += ExtractFromEquipmentDBDialog_Loaded;
     this.activityPlaceInfo = activityPlaceInfo;
 }
Пример #13
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;
        }