Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                tagSelector.SetDataSourceLeft(NetRadio.LocatingMonitor.Controls.__SelectTagUser.SelectTagUsers2);
            }
            ruleList.ItemDataBound += new RepeaterItemEventHandler(ruleList_ItemDataBound);
            //var list=(select new { a=1,b=2}).
            /////////////////////tagSelector.SelectedGroupId = -1;

            int deleteRuleId = Fetch.QueryUrlAsIntegerOrDefault("deleteRuleId", -1);

            if (deleteRuleId != -1)
            {
                if (!LocatingServiceUtil.IsAvailable())
                {
                    AreaWarningRule.Delete(deleteRuleId);
                    AreaWarningRuleCoverage.DeleteByRuleId(deleteRuleId);
                }
                else
                {
                    IServiceApi serviceApi = LocatingServiceUtil.Instance <IServiceApi>();
                    serviceApi.DeleteWarningRule(deleteRuleId);
                    serviceApi.DeleteWarningRuleCoverage(deleteRuleId);
                }
                Terminator.Redirect(Fetch.Referrer);
            }

            MapArea area = MapArea.Select(_id);

            areaName.Text     = area.AreaName;
            facilityName.Text = Facility.GetNameByMapId(area.MapId);

            IList <AreaWarningRule>         _p = AreaWarningRule.SelectRuleByAreaId(area.Id);
            IList <AreaWarningRuleCoverage> _c = AreaWarningRuleCoverage.GetAreaWarningRuleCoverages();

            _list = (from _p1 in _p
                     join _c1 in _c
                     on _p1.Id equals _c1.RuleId
                     join _h1 in HostTag.All
                     on _c1.TagId equals _h1.TagId
                     select new _temp
            {
                RuleId = _c1.RuleId,
                TagId = _c1.TagId,
                HostName = _h1.HostName
            }).ToList();

            ruleList.DataSource = _p;
            ruleList.DataBind();
            ruleCount.Value = ruleList.Items.Count;

            if (forAllTags.SelectedValue == "1")
            {
                tagSelectorContainer.Style.Add("display", "none");
            }
        }