예제 #1
0
        public bool AlertSettings_Update(string SN, AlertsSetting alertsSetting)
        {
            var Result       = false;
            int rowsAffected = 0;

            Connector.GetProcedureResultInt32("config.AlertSettings_Update",
                                              new IDataParameter[] {
                Connector.CreateParameter("SN", SN),
                Connector.CreateParameter("IsEnable", alertsSetting.IsEnable),
                Connector.CreateParameter("SendEmail", alertsSetting.SendEmail),
                Connector.CreateParameter("SendSMS", alertsSetting.SendSMS),
                Connector.CreateParameter("AlertCode", alertsSetting.AlertCode)
            }
                                              ,
                                              out rowsAffected,
                                              out Result);

            return(Result);
        }
예제 #2
0
        public AlertSettingsView(AlertsSetting AlertsSetting, bool SendDefaults)
        {
            Device_Settings = new DeviceAlertSettingsView()
            {
                AlertCode = AlertsSetting.AlertCode,
                Name      = AlertsSetting.Name,
                IsEnable  = AlertsSetting.IsEnable.HasValue ? AlertsSetting.IsEnable.Value : AlertsSetting.Default_IsActive,
                SendEmail = AlertsSetting.SendEmail.HasValue ? AlertsSetting.SendEmail.Value : AlertsSetting.Default_SendEmail,
                SendSMS   = AlertsSetting.SendSMS.HasValue ? AlertsSetting.SendSMS.Value : AlertsSetting.Default_SendSMS
            };

            if (SendDefaults)
            {
                Default_Settings = new DeviceAlertSettingsView()
                {
                    AlertCode = AlertsSetting.AlertCode,
                    Name      = AlertsSetting.Name,
                    IsEnable  = AlertsSetting.Default_IsActive,
                    SendEmail = AlertsSetting.Default_SendEmail,
                    SendSMS   = AlertsSetting.Default_SendSMS
                };
            }
        }