예제 #1
0
        private void _add_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // 在此处添加事件处理程序实现。
            DefenceRuleDataSource dr = new DefenceRuleDataSource();
            dr.week = 1;
            dr.stime = "00:00:00";
            dr.etime = "00:00:00";

            dm.DefenceList.Add(dr);
        }
예제 #2
0
        void initDefence()
        {
            _def = wsAdapter.queryDefenceByChannel(selectedCamera, selectedChannel);

            if (_def.dType != "ruleDefence")
            {
                setComboItem(_dType, "一键布撤防");
            }
            else
            {
                setComboItem(_dType, "规则布撤防");
            }

            if (_def.dState == "yes")
            {
                setComboItem(_dState, "布防");
            }
            else
            {
                setComboItem(_dState, "撤防");
            }

            foreach (DefenceRule dr in _def.defSRuleList)
            {
                DefenceRuleDataSource ds = new DefenceRuleDataSource();
                ds.week = dr.week;
                ds.stime = dr.stime;
                ds.etime = dr.etime;
                ds.isSelected = false;

                dm.DefenceList.Add(ds);
            }

            if (_def.dType == "onekeyDefence")
            {
                _ruleDefenceGrid.Visibility = Visibility.Hidden;
                return;
            }
        }