private void btnReset_Click(object sender, RoutedEventArgs e)
 {
     CurrentCondition = new OrgQueryCondition {
         ActivityGuid = CurrentCondition.ActivityGuid
     };
     InitCondition(CurrentCondition);
 }
 public ORGQueryDialog(OrgQueryCondition condition)
 {
     InitializeComponent();
     CurrentCondition   = condition;
     cbtype.ItemsSource = CO_IA.Client.Utility.GetSecurityClasses();
     InitCondition(CurrentCondition);
 }
Ejemplo n.º 3
0
 private Organization[] GetORGSource(OrgQueryCondition condition)
 {
     return(PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_PlanDatabase, Organization[]>(channel =>
     {
         return channel.GetOrgByCondition(condition);
     }));
 }
Ejemplo n.º 4
0
        //internal static List<PP_OrgInfo> GetPP_OrgInfosByActivityID(string p_activityID)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_PersonSchedule, List<PP_OrgInfo>>(channel =>
        //    {
        //        return channel.GetPP_OrgInfos(p_activityID);
        //    });
        //}

        ///// <summary>
        ///// 根据用户ID获取所在组织信息
        ///// </summary>
        ///// <returns></returns>
        //internal static PP_OrgInfo GetOrgInfoByUserID()
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_PersonSchedule, PP_OrgInfo>(channel =>
        //    {
        //        return channel.GetPP_OrgInfoByPersonID(RiasPortal.Current.UserSetting.UserID,RiasPortal.ModuleContainer.Activity.Guid);
        //    });
        //}

        //internal static List<ActivityEquipmentInfo> GetTaskListInfosByParam(EquipmentQueryCondition obj)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_FreqPlan, List<ActivityEquipmentInfo>>(channel =>
        //    {
        //        return channel.GetEquipmentInfos(obj);
        //    });
        //}

        //internal static List<EmitInfo> GetEmitInfo(string p_placeGuid)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_Collection, List<EmitInfo>>(channel =>
        //    {
        //        return channel.QueryEmitInfos(p_placeGuid);
        //    });
        //}
        ///// <summary>
        ///// 根据地点查询频率详细信息列表
        ///// </summary>
        ///// <param name="p_placeGuid"></param>
        ///// <returns></returns>
        //internal static List<FreqPlanActivity> GetFreqPlanActivitysByPlaceId(string p_placeGuid)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, List<FreqPlanActivity>>(channel =>
        //       {
        //          return channel.GetFreqPlanActivitys(p_placeGuid);
        //       });
        //}
        ///// <summary>
        ///// 根据频率id查询周围台站信息列表
        ///// </summary>
        ///// <param name="p_freqId"></param>
        ///// <returns></returns>
        //internal static List<RoundStationInfo> GetRoundStationByFreqID(string p_freqId)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_FreqPlan, List<RoundStationInfo>>(channel =>
        //    {
        //        return channel.QueryRoundStationsByFreq(p_freqId);
        //    });
        //}
        ///// <summary>
        ///// 根据频率段以及地点ID查询周围非法信号列表
        ///// </summary>
        ///// <param name="p_startFreq">起始频率,单位MHz</param>
        ///// <param name="p_endFreq">结束频率,单位MHz</param>
        ///// <param name="p_placeId"></param>
        ///// <returns></returns>
        //internal static List<AnalysisResult> GetsceneIllegalitySignalsByFreqValue(double p_startFreq, double p_endFreq, string p_placeId)
        //{
        //    return PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA_FreqPlan, List<AnalysisResult>>(channel =>
        //    {
        //        return channel.GetAnalysisResultList(p_startFreq, p_endFreq, p_placeId);
        //    });
        //}


        internal static ActivityOrganization[] GetORGSource(OrgQueryCondition condition)
        {
            return(PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation, ActivityOrganization[]>(channel =>
            {
                return channel.GetActivityOrgs(condition);
            }));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// XLS导入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnImportEqu_Click(object sender, RoutedEventArgs e)
        {
            SecurityClass[] securityclasses = CO_IA.Client.Utility.GetSecurityClasses();
            if (securityclasses == null || securityclasses.Length == 0)
            {
                MessageBox.Show("请先在基础数据设置中增加保障类别");
            }
            else
            {
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Filter = "Excel文件(*.xls)|*.xls";
                //dialog.Filter = "(*.xlsx)|*.xlsx|(*.xls)|*.xls";
                //dialog.DefaultExt = "xlsx";

                dialog.CheckFileExists = true;
                if (dialog.ShowDialog() == true)
                {
                    DataTable[] tables = ExcelImportHelper.LoadDataFromExcel(dialog.FileName);
                    if (tables != null && tables.Length > 0)
                    {
                        //单位信息
                        Organization orginfo  = null;
                        DataTable    orgtable = tables.FirstOrDefault(r => r.TableName == "单位信息");
                        if (orgtable != null && ExcelImportHelper.ValidateORG(orgtable))
                        {
                            orginfo = this.LoadORGFromTable(orgtable);
                        }
                        if (orginfo != null)
                        {
                            #region 验证单位名称

                            OrgQueryCondition condition = new OrgQueryCondition();
                            condition.Name = orginfo.Name;
                            Organization[] orgs    = this.GetORGSource(condition);
                            Organization   sameorg = orgs.FirstOrDefault(r => r.Name == orginfo.Name);
                            #endregion

                            if (sameorg != null)
                            {
                                MessageBoxResult result = MessageBox.Show(string.Format("'{0}'已经存在,是否将Excel中的设备导入到'{0}'中?", orginfo.Name), "提示", MessageBoxButton.YesNo);
                                if (result == MessageBoxResult.Yes)
                                {
                                    ImportEquipment(tables, sameorg);
                                }
                                else
                                {
                                    MessageBox.Show("请修改单位名称");
                                }
                            }
                            else
                            {
                                ImportEquipment(tables, orginfo);
                            }
                        }
                    }
                }
            }
        }
 private void btnQuery_Click(object sender, RoutedEventArgs e)
 {
     if (OnQueryEvent != null)
     {
         CurrentCondition = GetCondition();
         OnQueryEvent(CurrentCondition);
     }
     this.Close();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 查询单位信息
 /// </summary>
 /// <param name="condition"></param>
 private void GetORGbyCondition(OrgQueryCondition condition)
 {
     Organization[] source = GetORGSource(condition);
     orgListControl.DataContext = source;
     if (source == null || source.Length == 0)
     {
         equipmentListControl.DataContext = null;
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnQueryORG_Click(object sender, RoutedEventArgs e)
        {
            ORGQueryDialog querydialog = new ORGQueryDialog(orgquerycondition);

            querydialog.OnQueryEvent += (condition) =>
            {
                orgquerycondition = condition;
                this.GetORGbyCondition(condition);
            };
            querydialog.ShowDialog();
        }
        private void btnOrgQuery_Click(object sender, RoutedEventArgs e)
        {
            ORGQueryDialog querydialog = new ORGQueryDialog(orgquerycondition);

            querydialog.OnQueryEvent += (condition) =>
            {
                orgquerycondition = condition;

                this.GetActivityOrgs(condition);
            };
            querydialog.ShowDialog();
        }
Ejemplo n.º 10
0
        public static void Import(Action <ActivityOrganization, List <ActivityEquipment> > p_importEquips)
        {
            ImportEquipmentDelegate = p_importEquips;
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter     = "Excel文件(*.xls)|*.xls";
            dialog.DefaultExt = "xls";

            dialog.CheckFileExists = true;
            if (dialog.ShowDialog() == true)
            {
                DataTable[] tables = ExcelImportHelper.LoadDataFromExcel(dialog.FileName);
                if (tables != null && tables.Length > 0)
                {
                    //单位信息
                    ActivityOrganization activityorg = null;
                    DataTable            orgtable    = tables.FirstOrDefault(r => r.TableName == "单位信息");
                    if (orgtable != null && ExcelImportHelper.ValidateORG(orgtable))
                    {
                        activityorg = LoadActivityORGFromTable(orgtable, SystemLoginService.CurrentActivity.Guid);
                    }
                    if (activityorg != null)
                    {
                        #region 验证单位名称
                        OrgQueryCondition condition = new OrgQueryCondition();
                        condition.ActivityGuid = SystemLoginService.CurrentActivity.Guid;
                        condition.Name         = activityorg.Name;
                        ActivityOrganization[] orgs    = DataOperator.GetActivityOrgSources(condition);
                        ActivityOrganization   sameorg = orgs.FirstOrDefault(r => r.Name == activityorg.Name);
                        #endregion

                        if (sameorg != null)
                        {
                            MessageBoxResult result = MessageBox.Show(string.Format("单位'{0}'已经存在,是否将Excel中的设备导入到现有的单位中?", activityorg.Name), "提示", MessageBoxButton.YesNo);
                            if (result == MessageBoxResult.Yes)
                            {
                                ImportActivityEquipment(tables, sameorg);
                            }
                            else
                            {
                                MessageBox.Show("请修改单位名称");
                            }
                        }
                        else
                        {
                            ImportActivityEquipment(tables, activityorg);
                        }
                    }
                }
            }
        }
        private OrgQueryCondition GetCondition()
        {
            OrgQueryCondition condition = new OrgQueryCondition();

            condition.ActivityGuid = CurrentCondition.ActivityGuid;
            condition.Name         = this.txtName.Text;
            condition.Address      = this.txtAddress.Text;
            if (cbtype.SelectedItems.Count > 0)
            {
                List <string> classes = cbtype.SelectedItems.Select(r => ((SecurityClass)r).Guid).ToList();
                condition.SecurityClasses = classes;
            }
            return(condition);
        }
        /// <summary>
        /// 查询单位信息
        /// </summary>
        /// <param name="condition"></param>
        private void GetActivityOrgs(OrgQueryCondition condition)
        {
            ActivityOrganization[] source = GetActivityOrgSources(condition);

            orgdatagrid.ItemsSource = source;

            if (source != null && source.Length > 0)
            {
                orgdatagrid.SelectedIndex = 0;
            }
            else
            {
                equipmentListControl.DataContext = null;
            }
        }
        private void InitCondition(OrgQueryCondition queryCondition)
        {
            cbtype.UnselectAllItems();
            this.txtName.Text    = queryCondition.Name;
            this.txtAddress.Text = queryCondition.Address;

            if (queryCondition.SecurityClasses != null && queryCondition.SecurityClasses.Count > 0)
            {
                List <string> classes = queryCondition.SecurityClasses;
                foreach (SecurityClass type in cbtype.ItemsSource as SecurityClass[])
                {
                    if (classes.Contains(type.Guid))
                    {
                        cbtype.SelectedItems.Add(type);
                    }
                }
            }
        }
        /// <summary>
        /// 保存单位信息
        /// </summary>
        private void SaveORGInfos()
        {
            if (this.ORGDataContent != null)
            {
                if (ValidORG(this.ORGDataContent))
                {
                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation>(org =>
                    {
                        string orgguid = ORGDataContent.Guid;

                        #region 验证单位名称
                        OrgQueryCondition condition = new OrgQueryCondition();
                        condition.ActivityGuid      = RiasPortal.ModuleContainer.Activity.Guid;
                        condition.Name = ORGDataContent.Name;
                        ActivityOrganization[] orgs  = org.GetActivityOrgs(condition);
                        ActivityOrganization sameorg = orgs.FirstOrDefault(r => r.Name == ORGDataContent.Name && r.Guid != ORGDataContent.Guid);
                        #endregion

                        if (sameorg == null)
                        {
                            try
                            {
                                org.SaveActivityOrg(this.ORGDataContent);
                                MessageBox.Show("保存成功");
                                GetORGInfos(SelectedORG);
                                chkAll.IsChecked       = false;
                                IsORGItemSourceChanged = true;
                                IsPropertyChanged      = false;
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.GetExceptionMessage());
                            }
                        }
                        else
                        {
                            MessageBox.Show("单位名称已经存在,请重新输入");
                            this.txtName.Focus();
                            this.ORGDataContent.Name = SelectedORG.Name;
                        }
                    });
                }
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 保存单位信息
        /// </summary>
        private void SaveORGInfos()
        {
            if (this.ORGDataContent != null)
            {
                if (ValidORG(this.ORGDataContent))
                {
                    PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA_FreqStation>(org =>
                    {
                        string orgguid = ORGDataContent.Guid;

                        #region 验证单位名称
                        OrgQueryCondition condition = new OrgQueryCondition();
                        condition.ActivityGuid      = SystemLoginService.CurrentActivity.Guid;
                        condition.Name = ORGDataContent.Name;
                        ActivityOrganization[] orgs  = org.GetActivityOrgs(condition);
                        ActivityOrganization sameorg = orgs.FirstOrDefault(r => r.Name == ORGDataContent.Name && r.Guid != ORGDataContent.Guid);
                        #endregion

                        if (sameorg == null)
                        {
                            try
                            {
                                org.SaveActivityOrg(this.ORGDataContent);
                                MessageBox.Show("保存成功");
                                this.Close();
                                if (AfterSave != null)
                                {
                                    AfterSave(this.ORGDataContent);
                                }
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.GetExceptionMessage());
                            }
                        }
                        else
                        {
                            MessageBox.Show("单位名称已经存在,请重新输入");
                        }
                    });
                }
            }
        }
Ejemplo n.º 16
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));
                                }
                            }
                        }
                    }
                }
            }
        }