Пример #1
0
        public static void SetObjectPreAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            List <string> list = new List <string>();

            if (DBNull.Value.Equals(inputRow["MinPasswordComplexCharacters"]))
            {
                inputRow["MinPasswordComplexCharacters"] = "3";
                list.Add("MinPasswordComplexCharacters");
            }
            if (DBNull.Value != inputRow["MaxPasswordFailedAttempts"] || DBNull.Value != inputRow["IsMaxPasswordFailedAttemptsSet"])
            {
                bool   isValueSet = DBNull.Value.Equals(inputRow["IsMaxPasswordFailedAttemptsSet"]) || (bool)inputRow["IsMaxPasswordFailedAttemptsSet"];
                string value      = (DBNull.Value != inputRow["MaxPasswordFailedAttempts"]) ? ((string)inputRow["MaxPasswordFailedAttempts"]) : "8";
                object value2;
                if (MobileDeviceMailboxPolicyService.CheckAndParseParams <int>(true, isValueSet, value, (string x) => int.Parse(x), out value2))
                {
                    inputRow["MaxPasswordFailedAttempts"] = value2;
                    list.Add("MaxPasswordFailedAttempts");
                    list.Add("IsMaxPasswordFailedAttemptsSet");
                }
            }
            if (DBNull.Value != inputRow["PasswordExpiration"] || DBNull.Value != inputRow["IsPasswordExpirationSet"])
            {
                bool   isValueSet = DBNull.Value.Equals(inputRow["IsPasswordExpirationSet"]) || (bool)inputRow["IsPasswordExpirationSet"];
                string value      = (DBNull.Value != inputRow["PasswordExpiration"]) ? ((string)inputRow["PasswordExpiration"]) : "90";
                object value2;
                if (MobileDeviceMailboxPolicyService.CheckAndParseParams <EnhancedTimeSpan>(true, isValueSet, value, (string x) => EnhancedTimeSpan.FromDays(double.Parse(x)), out value2))
                {
                    inputRow["PasswordExpiration"] = value2;
                    list.Add("PasswordExpiration");
                    list.Add("IsPasswordExpirationSet");
                }
            }
            if (DBNull.Value != inputRow["MaxInactivityTimeLock"] || DBNull.Value != inputRow["IsMaxInactivityTimeLockSet"])
            {
                bool   isValueSet = DBNull.Value.Equals(inputRow["IsMaxInactivityTimeLockSet"]) || (bool)inputRow["IsMaxInactivityTimeLockSet"];
                string value      = (DBNull.Value != inputRow["MaxInactivityTimeLock"]) ? ((string)inputRow["MaxInactivityTimeLock"]) : "15";
                object value2;
                if (MobileDeviceMailboxPolicyService.CheckAndParseParams <EnhancedTimeSpan>(true, isValueSet, value, (string x) => EnhancedTimeSpan.FromMinutes(double.Parse(x)), out value2))
                {
                    inputRow["MaxInactivityTimeLock"] = value2;
                    list.Add("MaxInactivityTimeLock");
                    list.Add("IsMaxInactivityTimeLockSet");
                }
            }
            if (DBNull.Value != inputRow["MinPasswordLength"] || DBNull.Value != inputRow["IsMinPasswordLengthSet"])
            {
                bool   isValueSet = DBNull.Value.Equals(inputRow["IsMinPasswordLengthSet"]) || (bool)inputRow["IsMinPasswordLengthSet"];
                string value      = (DBNull.Value != inputRow["MinPasswordLength"]) ? ((string)inputRow["MinPasswordLength"]) : 4.ToString();
                object value2;
                if (MobileDeviceMailboxPolicyService.CheckAndParseParams <int>(false, isValueSet, value, (string x) => int.Parse(x), out value2))
                {
                    inputRow["MinPasswordLength"] = value2;
                    list.Add("MinPasswordLength");
                    list.Add("IsMinPasswordLengthSet");
                }
            }
            if (list.Count > 0)
            {
                store.SetModifiedColumns(list);
            }
        }
Пример #2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     base.ValidateSProcExists("[Exchange2010].[TransportReporting_GetMessageLatency]");
     if (base.Fields.IsModified("SlaTargetTimespan") && (this.SlaTargetTimespan > EnhancedTimeSpan.FromMinutes(5.0) || this.SlaTargetTimespan < EnhancedTimeSpan.FromSeconds(1.0)))
     {
         base.WriteError(new ArgumentException(Strings.OutOfRangeSlaTaget(EnhancedTimeSpan.FromSeconds(1.0).ToString(), EnhancedTimeSpan.FromMinutes(5.0).ToString())), (ErrorCategory)1000, null);
     }
     TaskLogger.LogExit();
 }
 protected override object ParseObject(string s, IFormatProvider provider)
 {
     return(EnhancedTimeSpan.FromMinutes((double)long.Parse(s)));
 }