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

            MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "IssueWarningQuota", list);
            MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "ProhibitSendQuota", list);
            MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "ProhibitSendReceiveQuota", list);
            if (DBNull.Value != dataRow["DeletedItemRetention"])
            {
                dataRow["DeletedItemRetention"] = EnhancedTimeSpan.Parse((string)dataRow["DeletedItemRetention"]);
                list.Add("DeletedItemRetention");
            }
            if (DBNull.Value != dataRow["MailboxRetention"])
            {
                dataRow["MailboxRetention"] = EnhancedTimeSpan.Parse((string)dataRow["MailboxRetention"]);
                list.Add("MailboxRetention");
            }
            DatabasePropertiesHelper.SetScheduleProperty(dataRow, "MaintenanceSchedule", list);
            DatabasePropertiesHelper.SetScheduleProperty(dataRow, "QuotaNotificationSchedule", list);
            if (list.Count != 0)
            {
                store.SetModifiedColumns(list);
            }
        }
        public static void SetObjectPreAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow       dataRow = dataTable.Rows[0];
            List <string> list    = new List <string>();

            if (DBNull.Value != inputRow["IssueWarningQuota"] || DBNull.Value != inputRow["ProhibitPostQuota"] || DBNull.Value != inputRow["MaxItemSize"] || DBNull.Value != inputRow["IsStorageQuotasSet"])
            {
                if (DBNull.Value != inputRow["IsStorageQuotasSet"] && (bool)inputRow["IsStorageQuotasSet"])
                {
                    dataRow["IssueWarningQuota"] = Unlimited <ByteQuantifiedSize> .UnlimitedString;
                    dataRow["ProhibitPostQuota"] = Unlimited <ByteQuantifiedSize> .UnlimitedString;
                    dataRow["MaxItemSize"]       = Unlimited <ByteQuantifiedSize> .UnlimitedString;
                }
                MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "IssueWarningQuota", list);
                MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "ProhibitPostQuota", list);
                MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "MaxItemSize", list);
            }
            if (DBNull.Value != inputRow["RetainDeletedItemsFor"] || DBNull.Value != inputRow["IsRetainDeletedItemsForSet"])
            {
                if (DBNull.Value != inputRow["IsRetainDeletedItemsForSet"] && (bool)inputRow["IsRetainDeletedItemsForSet"])
                {
                    dataRow["RetainDeletedItemsFor"] = null;
                }
                else
                {
                    dataRow["RetainDeletedItemsFor"] = EnhancedTimeSpan.Parse((string)dataRow["RetainDeletedItemsFor"]);
                }
                list.Add("RetainDeletedItemsFor");
                list.Add("IsRetainDeletedItemsForSet");
            }
            if (DBNull.Value != inputRow["AgeLimit"] || DBNull.Value != inputRow["IsAgeLimitSet"])
            {
                if (DBNull.Value != inputRow["IsAgeLimitSet"] && (bool)inputRow["IsAgeLimitSet"])
                {
                    dataRow["AgeLimit"] = null;
                }
                else
                {
                    dataRow["AgeLimit"] = EnhancedTimeSpan.Parse((string)dataRow["AgeLimit"]);
                }
                list.Add("AgeLimit");
                list.Add("IsAgeLimitSet");
            }
            MailboxPropertiesHelper.SetMaxSendReceiveSize(inputRow, dataTable, store);
            if (list.Count > 0)
            {
                store.SetModifiedColumns(list);
            }
        }