Example #1
0
 /// <summary>
 /// 查询设备
 /// </summary>
 /// <param name="condition"></param>
 private void GetActivityEquipments(EquipmentLoadStrategy condition)
 {
     condition.ActivityGuid = this.CurrentActivityPlace.ActivityGuid;
     condition.PlaceGuid    = this.CurrentActivityPlace.Guid;
     ActivityEquipment[] sources = FreqStationHelper.GetActivityEquipments(condition);
     freqAssignListControl.DataContext = sources;
 }
Example #2
0
 /// <summary>
 /// 查询设备
 /// </summary>
 /// <param name="condition"></param>
 private void GetEquipments(EquipmentLoadStrategy condition)
 {
     PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.PlanDatabase.I_CO_IA_PlanDatabase>(channel =>
     {
         equipmentListControl.DataContext = channel.GetEquipments(condition);
     });
 }
Example #3
0
 /// <summary>
 /// 查询监测设备列表
 /// </summary>
 /// <param name="p_equipmentLoadStrategy"></param>
 /// <returns></returns>
 internal static ActivityEquipment[] GetEquipments(EquipmentLoadStrategy p_equipmentLoadStrategy)
 {
     return(PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation, ActivityEquipment[]>(channel =>
     {
         return channel.GetActivityEquipments(p_equipmentLoadStrategy);
     }));
 }
Example #4
0
 /// <summary>
 /// 查询设备
 /// </summary>
 /// <param name="condition"></param>
 private ActivityEquipment[] GetActivityEquipments(EquipmentLoadStrategy condition)
 {
     return(PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation, ActivityEquipment[]>(channel =>
     {
         return channel.GetActivityEquipments(condition);
     }));
 }
Example #5
0
        private EquipmentLoadStrategy GetEquipmentLoadStrategy()
        {
            EquipmentLoadStrategy loadstrategy = this.DataContext as EquipmentLoadStrategy;

            loadstrategy.EquipClasses = comboBoxClass.SelectedItems.Select(r => ((EquipmentClass)r).Guid).ToArray();
            return(loadstrategy);
        }
Example #6
0
        private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var item = (sender as DataGrid).SelectedItem;

            if (item == null)
            {
                return;
            }
            LoadEquipmentsForOrg();

            if (item is ActivityOrganization)
            {
                EquipmentLoadStrategy strategy = new EquipmentLoadStrategy();
                strategy.ActivityGuid = SystemLoginService.CurrentActivity.Guid;
                strategy.PlaceGuid    = SystemLoginService.CurrentActivityPlace.Guid;
                strategy.OrgName      = (item as ActivityOrganization).Name;
                if (DataOperator.GetEquipments(strategy).Length > 0)
                {
                    xDeleteButton.IsEnabled = false;
                }
                else
                {
                    xDeleteButton.IsEnabled = true;
                }
            }
        }
Example #7
0
 public EquipmentQueryDialog(EquipmentLoadStrategy loadStrategy)
 {
     InitializeComponent();
     LoadStrategy     = loadStrategy;
     this.DataContext = LoadStrategy;
     InitData();
     InitCondition(LoadStrategy);
 }
 /// <summary>
 /// 查询设备
 /// </summary>
 /// <param name="condition"></param>
 private void GetActivityEquipments(EquipmentLoadStrategy condition)
 {
     PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation>(channel =>
     {
         ActivityEquipment[] sources      = channel.GetActivityEquipments(condition);
         equipmentListControl.DataContext = sources;
     });
 }
Example #9
0
        /// <summary>
        /// 重置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnReset_Click(object sender, RoutedEventArgs e)
        {
            EquipmentLoadStrategy loadstrategy = this.DataContext as EquipmentLoadStrategy;
            EquipmentLoadStrategy strategy     = new EquipmentLoadStrategy();

            comboBoxClass.UnselectAllItems();
            this.DataContext = strategy;
        }
 private void InitQueryCondition(EquipmentLoadStrategy condition)
 {
     condition.ActivityGuid = CurrentActivity.Guid;
     condition.PlaceGuid    = CurrentActivityPlaceID;
     if (SelectActivityORG != null)
     {
         condition.OrgName = SelectActivityORG.Name;
     }
 }
 private void orgdatagrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (SelectActivityORG != null)
     {
         eququerycondition = new EquipmentLoadStrategy();
         InitQueryCondition(eququerycondition);
         GetActivityEquipments(eququerycondition);
     }
 }
Example #12
0
        /// <summary>
        /// 查询设备
        /// </summary>
        /// <param name="condition"></param>
        public static ActivityEquipment[] QueryActivityEquipments(EquipmentLoadStrategy condition)
        {
            //return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_FreqStation, ActivityEquipment[]>(channel =>
            //   {
            //       return channel.GetActivityEquipments(condition);
            //   });


            return(null);
        }
Example #13
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, RoutedEventArgs e)
        {
            EquipmentLoadStrategy strategy = GetEquipmentLoadStrategy();

            if (OnQueryEvent != null)
            {
                OnQueryEvent(strategy);
                this.Close();
            }
        }
Example #14
0
        /// <summary>
        /// 查询设备
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void xEquQuery_Click(object sender, RoutedEventArgs e)
        {
            EquipmentQueryDialog querydialog = new EquipmentQueryDialog(eququerycondition);

            querydialog.ORGNameIsReadOnly = false;
            querydialog.OnQueryEvent     += (condition) =>
            {
                eququerycondition = condition;
                this.GetActivityEquipments(condition);
            };
            querydialog.ShowDialog();
        }
Example #15
0
        /// <summary>
        /// 单位换行事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void orgdatagrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (SelectedORG != null)
            {
                eququerycondition         = new EquipmentLoadStrategy();
                eququerycondition.OrgName = SelectedORG.Name;

                BeOperationInvoker.Invoke <I_CO_IA_PlanDatabase>(channel =>
                {
                    equipmentListControl.DataContext = channel.GetEquipmentsForOrg(SelectedORG.Guid);
                });
            }
        }
Example #16
0
        private void orgListControl_SelectionChanged(Data.Organization obj)
        {
            if (obj != null)
            {
                EquipmentLoadStrategy eququerycondition = new EquipmentLoadStrategy();
                eququerycondition.OrgName = obj.Name;

                BeOperationInvoker.Invoke <I_CO_IA_PlanDatabase>(channel =>
                {
                    equListControl.DataContext = channel.GetEquipmentsForOrg(obj.Guid);
                });
            }
        }
        /// <summary>
        /// 查询设备
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEquQuery_Click(object sender, RoutedEventArgs e)
        {
            EquipmentQueryDialog querydialog = new EquipmentQueryDialog(eququerycondition);

            querydialog.ORGNameIsReadOnly = true;
            querydialog.OnQueryEvent     += (condition) =>
            {
                eququerycondition = condition;
                eququerycondition.ActivityGuid = CurrentActivity.Guid;
                eququerycondition.PlaceGuid    = CurrentActivityPlace.Guid;

                this.GetActivityEquipments(condition);
            };
            querydialog.ShowDialog();
        }
Example #18
0
 private void InitCondition(EquipmentLoadStrategy loadstrategy)
 {
     this.comboBoxClass.UnselectAllItems();
     if (loadstrategy.EquipClasses != null)
     {
         string[] classes = loadstrategy.EquipClasses;
         foreach (EquipmentClass equclass in comboBoxClass.ItemsSource as EquipmentClass[])
         {
             if (classes.Contains(equclass.Guid))
             {
                 comboBoxClass.SelectedItems.Add(equclass);
             }
         }
     }
 }
Example #19
0
        private void LoadData()
        {
            OrgQueryCondition condition = new OrgQueryCondition();

            condition.ActivityGuid = Obj.Activity.Guid;
            ActivityOrganization[] orgs = GetActivityOrgSources(condition);

            if (orgs != null && orgs.Length > 0)
            {
                if (Obj.ActivityPlaces != null && Obj.ActivityPlaces.Length > 0)
                {
                    ContextMenu           contextMenu  = GetContextMenu();
                    EquipmentLoadStrategy equcondition = new EquipmentLoadStrategy();

                    foreach (var item in Obj.ActivityPlaces)
                    {
                        foreach (ActivityOrganization org in orgs)
                        {
                            equcondition.ActivityGuid = Obj.Activity.Guid;
                            equcondition.PlaceGuid    = item.Guid;
                            equcondition.OrgName      = org.Name;
                            ActivityEquipment[] equlist = GetActivityEquipments(equcondition);
                            if (equlist != null && equlist.Length > 0)
                            {
                                foreach (ActivityEquipment equ in equlist)
                                {
                                    if (!Obj.screenMap.CheckCoordinate(new double[] { equ.Longitude == null ? 0 : equ.Longitude.Value, equ.Latitude == null ? 0 : equ.Latitude.Value }))
                                    {
                                        continue;
                                    }
                                    OrgEqu orgequ = new OrgEqu(org, equ);
                                    orgequ.ContextMenu = contextMenu;
                                    Obj.screenMap.AddElement(orgequ, Obj.screenMap.GetMapPointEx(equ.Longitude.Value, equ.Latitude.Value));
                                }
                            }
                        }
                    }
                }
            }
        }
Example #20
0
        private StateData GetPrepareData()
        {
            StateData             preData      = new StateData();
            EquipmentLoadStrategy equcondition = new EquipmentLoadStrategy();

            equcondition.ActivityGuid = Obj.Activity.Guid;
            ActivityEquipment[] equlist = GetActivityEquipments(equcondition);
            if (equlist != null && equlist.Length > 0)
            {
                if (!string.IsNullOrEmpty(Obj.SelectedAreaID))
                {
                    equlist = equlist.Where(item => item.PlaceGuid == Obj.SelectedAreaID).ToArray();
                }
                preData.PlanFreqPointNum = equlist.Length;
                foreach (var item in equlist)
                {
                    if (item.SpareFreq != null)
                    {
                        preData.ApplyFreqPointNum++;
                    }
                }
            }
            return(preData);
        }
Example #21
0
        /// <summary>
        /// 频率指配统计详情
        /// </summary>
        /// <param name="equloadstrategy"></param>
        /// <param name="freqtype">发射频率指配数量、备用频率指配数量</param>
        private void QueryFreqAssignStatisticDetail(EquipmentLoadStrategy equloadstrategy, string freqtype)
        {
            //ActivityEquipment[] equsource = StatisticHelper.QueryActivityEquipments(equloadstrategy);
            //if (equsource != null)
            //{
            //    ActivityEquipment[] activityequs = null;
            //    if (freqtype == "发射频率指配数量")
            //    {
            //        activityequs = equsource.Where(r => r.AssignSendFreq != null).ToArray();
            //    }
            //    else if (freqtype == "备用频率指配数量")
            //    {
            //        activityequs = equsource.Where(r => r.AssignSpareFreq != null).ToArray();
            //    }

            //    FreqAssignListControl freqassignlstcontrol = new FreqAssignListControl();
            //    freqassignlstcontrol.DataContext = activityequs;
            //    SetStatisticDetailControl(freqassignlstcontrol);
            //}
            //else
            //{
            //    MessageBox.Show("设备出现异常");
            //}
        }
Example #22
0
 private void querydialog_OnQueryEvent(EquipmentLoadStrategy obj)
 {
     eququerycondition = obj;
     GetEquipments(eququerycondition);
 }
Example #23
0
 /// <summary>
 /// 设备统计详情
 /// </summary>
 /// <param name="equloadstrategy"></param>
 private void QueryEQUStatisticDetail(EquipmentLoadStrategy equloadstrategy)
 {
     ActivityEquipment[] activityequs = StatisticHelper.QueryActivityEquipments(equloadstrategy);
     CreateActivityEquipmentListControl(activityequs);
 }
Example #24
0
        /// <summary>
        /// 单元格单击事件
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="placeguid"></param>
        private void statisticListControl_OnCellClick(StatisticDataSource datasource, string placeguid)
        {
            string activityguid = CO_IA.Client.RiasPortal.ModuleContainer.Activity.Guid;
            EquipmentLoadStrategy equloadstrategy;
            string condition = datasource.Group;

            switch (StatisticType)
            {
                #region  设备和台站
            case StatisticTypes.ORGAndEQUStatisticType:
                equloadstrategy = new EquipmentLoadStrategy();
                equloadstrategy.ActivityGuid = activityguid;
                equloadstrategy.PlaceGuid    = placeguid;
                equloadstrategy.OrgName      = condition;
                QueryEQUStatisticDetail(equloadstrategy);
                break;
                #endregion

                #region 周围台站
            case StatisticTypes.SurroundStatStatisticType:
                QuerySurroundStatStatisticDetail(activityguid, placeguid, condition);
                break;
                #endregion

                #region 频率指配
            case StatisticTypes.FreqAssignStatisticType:
                equloadstrategy = new EquipmentLoadStrategy();
                equloadstrategy.ActivityGuid = activityguid;
                equloadstrategy.PlaceGuid    = placeguid;
                QueryFreqAssignStatisticDetail(equloadstrategy, condition);
                break;
                #endregion

                #region 设备检测
            case StatisticTypes.EquInspectionSticType:
                EquInspectionQueryCondition loadcondition = new EquInspectionQueryCondition();
                loadcondition.ActivityGuid = activityguid;
                loadcondition.PlaceGuid    = placeguid;
                InspectionStateEnum state;
                if (Enum.TryParse(condition, out state))
                {
                    switch (state)
                    {
                    case InspectionStateEnum.总数:
                        loadcondition.CheckState = new List <CheckStateEnum>()
                        {
                        };
                        break;

                    case InspectionStateEnum.检测通过:
                        loadcondition.CheckState = new List <CheckStateEnum>()
                        {
                            CheckStateEnum.Qualified
                        };
                        break;

                    case InspectionStateEnum.检测未通过:
                        loadcondition.CheckState = new List <CheckStateEnum>()
                        {
                            CheckStateEnum.UnQualified
                        };

                        break;

                    case InspectionStateEnum.未检测:
                        loadcondition.CheckState = new List <CheckStateEnum>()
                        {
                            CheckStateEnum.UnCheck
                        };
                        break;
                    }

                    QueryEquInspectionStatisticDetail(loadcondition);
                }
                break;
                #endregion

                #region 人员预案
            case StatisticTypes.PersonPlanStatisticType:
                string orgguid = datasource.GroupGuid;
                if (orgguid == "total")
                {
                    orgguid = string.Empty;
                }

                string type = placeguid;
                switch (type)
                {
                    //case "设备":
                    //    EquList equlst = new EquList();
                    //    equlst.OrgID = orgguid;
                    //    SetStatisticDetailControl(equlst);
                    //    break;
                    //case "人员":
                    //    PersonList personlist = new PersonList();
                    //    personlist.OrgID = orgguid;
                    //    SetStatisticDetailControl(personlist);
                    //    break;
                    //case "车辆":
                    //    VehicleList vehiclelst = new VehicleList();
                    //    vehiclelst.OrgID = orgguid;
                    //    SetStatisticDetailControl(vehiclelst);
                    //    break;
                }
                break;
                #endregion
            }
        }