コード例 #1
0
        /// <summary>
        /// 取出需要删除掉的hostid
        /// </summary>
        /// <param name="delhostIds"></param>
        /// <param name="groupid"></param>
        /// <param name="MapId"></param>
        /// <param name="hostIds"></param>
        ///

        private void GetDelIDs(out int[] delhostIds, int groupid, int MapId, int[] hostIds)
        {
            LocatingServiceUtil.DemandLocatingService();
            IServiceApi serviceApi  = LocatingServiceUtil.Instance <IServiceApi>();
            List <int>  ihostid     = new List <int>();
            bool        bExist      = false;
            int         itotalcount = 0;
            int         imapid      = MapId;

            int[]           FindHostIDByGroup = new int[] { groupid };
            TagStatusView[] tgv = serviceApi.SelectTagStatusListByKeywords(
                "",
                FindHostIDByGroup,
                MapId,
                false,
                false,
                false,
                false,
                false,
                false,
                "TagName",
                SortDirection.Ascending,
                50,
                0,
                out itotalcount
                );
            for (int k = 0; k < tgv.Count(); k++)
            {
                for (int m = 0; m < hostIds.Count(); m++)
                {
                    if (tgv[k].HostTag.HostId == hostIds[m])
                    {
                        bExist = true;
                        break;
                    }
                }
                if (bExist)
                {
                    bExist = false;
                    continue;
                }
                else
                {
                    ihostid.Add(tgv[k].HostTag.HostId);
                }
            }
            if (ihostid.Count() > 0)
            {
                ihostid.Add(-1);
            }

            delhostIds = ihostid.ToArray();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!LocatingServiceUtil.IsAvailable())
            {
                ShowMessagePage("服务器程序未启动,无法获得实时监房统计。");
            }

            LocatingServiceUtil.DemandLocatingService();
            string areaname = Request.QueryString["areaname"].Trim();

            if (!string.IsNullOrEmpty(areaname))
            {
                list.DataSource = MapArea.All.Where(_d => _d.AreaName.Trim().Substring(0, 1) == areaname);
                list.DataBind();
            }
        }