private void Init()
        {
            IsSwitchEnable = false;
            IsMoNiEnable = false;

            SaveEnable = false;
            DeleteEnable = false;

            if (_Sta == null)
                return;
            SaveEnable = true;
            BindEvent();

             AlarmPolicyManagementObj = new AlarmPolicyManagementDA().selectARowDate(_Sta.StationID, _Sta.DeviceTypeID
                   , _Sta.Deviceid,_Sta.Channelno);

             if (AlarmPolicyManagementObj == null)
             {
                 OperationType = OpType.Add;
                 AlarmPolicyManagementObj = new AlarmPolicyManagementOR();
             }
             else
             {
                 DeleteEnable = true;
                 OperationType = OpType.Alert;
                 showAlarmPolicyInfo(AlarmPolicyManagementObj);
             }

            AlarmPolicyManagementObj.Stationid = _Sta.StationID;
            AlarmPolicyManagementObj.StationName = _Station.selectARowDate(_Sta.StationID).Stationname;

            AlarmPolicyManagementObj.Deviceid = _Sta.Deviceid;
            AlarmPolicyManagementObj.DeviceName = _Device.GetDeviceName(_Sta.Deviceid);

            AlarmPolicyManagementObj.Devicetypeid = _Sta.DeviceTypeID;
            AlarmPolicyManagementObj.DevicetypeName = _Device.GetDeviceTypeName(_Sta.DeviceTypeID);

            AlarmPolicyManagementObj.Devicechannelid = _Sta.Channelno;
            AlarmPolicyManagementObj.DeviceChannelName = _Device.GetChannelName(_Sta.Channelno);

            int ValueType = _Device.GetChannelValueType(_Sta.Deviceid, _Sta.Channelno);

            AlarmPolicyManagementObj.Valuetype = ValueType;
            if (ValueType == 1)
            {
                AlarmPolicyManagementObj.ValuetypeShow = "开关量";
                IsMoNiEnable = true;
                IsSwitchEnable = false;
            }
            else
            {
                AlarmPolicyManagementObj.ValuetypeShow = "模拟量";
                IsMoNiEnable = false;
                IsSwitchEnable = true;
            }

            //加载短信默认值
               DefaultSmsMsg = new SysParaDA().selectARowDate("defaultSmsMsg").Valstr;
               AlarmPolicyManagementObj.Smsmsg = DefaultSmsMsg;
        }
        private void Init()
        {
            _Window.cbStation.SelectionChanged += new SelectionChangedEventHandler(cbStation_SelectionChanged);
            _Window.cbDeviceID.SelectionChanged += new SelectionChangedEventHandler(cbDeviceID_SelectionChanged);

            StationDA _staDA = new StationDA();
            StationORList = _staDA.selectAllStation();

            if (OperationType == OpType.Alert)
            {
                SetFalseType(FalseAlarmPolicyObj.Falsetype);
                if (StationORList != null && FalseAlarmPolicyObj != null)
                {
                    AlarmPolicyObj = new AlarmPolicyManagementDA().selectARowDate(FalseAlarmPolicyObj.Policyid.ToString());

                    var vS = from f in StationORList where f.Stationid == AlarmPolicyObj.Stationid select f;
                    if (vS.Count() != 0)
                        SelectStationOR = vS.First();
                }
            }
        }