diff --git a/Basic/Types/BasicMediaEntry.cs b/Basic/Types/BasicMediaEntry.cs index a9bba831..aeb6ed7e 100644 --- a/Basic/Types/BasicMediaEntry.cs +++ b/Basic/Types/BasicMediaEntry.cs @@ -1,4 +1,5 @@ using System; +using Swarmops.Common; using Swarmops.Common.Interfaces; namespace Swarmops.Basic.Types @@ -42,7 +43,7 @@ namespace Swarmops.Basic.Types } public BasicMediaEntry() - : this (0, 0, string.Empty, false, string.Empty, string.Empty, DateTime.MinValue) + : this (0, 0, string.Empty, false, string.Empty, string.Empty, Constants.DateTimeLow) { } diff --git a/Basic/Types/Communications/BasicOutboundMail.cs b/Basic/Types/Communications/BasicOutboundMail.cs index a83f8d7d..62025002 100644 --- a/Basic/Types/Communications/BasicOutboundMail.cs +++ b/Basic/Types/Communications/BasicOutboundMail.cs @@ -1,4 +1,5 @@ using System; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Common.Interfaces; @@ -57,7 +58,7 @@ namespace Swarmops.Basic.Types.Communications : this (outboundMailId, authorType, authorPersonId, title, body, mailPriority, mailType, organizationId, geographyId, createdDateTime, releaseDateTime, - false, false, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, 0, 0, 0) + false, false, false, Constants.DateTimeLow, Constants.DateTimeLow, Constants.DateTimeLow, 0, 0, 0) { // nothing more to do } diff --git a/Basic/Types/Swarm/BasicParticipation.cs b/Basic/Types/Swarm/BasicParticipation.cs index 948a1051..63355297 100644 --- a/Basic/Types/Swarm/BasicParticipation.cs +++ b/Basic/Types/Swarm/BasicParticipation.cs @@ -1,4 +1,5 @@ using System; +using Swarmops.Common; using Swarmops.Common.Interfaces; namespace Swarmops.Basic.Types.Swarm @@ -10,7 +11,7 @@ namespace Swarmops.Basic.Types.Swarm this.PersonId = personId; this.OrganizationId = organizationId; this.Active = true; - this.DateTerminated = DateTime.MinValue; + this.DateTerminated = Constants.DateTimeLow; } public BasicParticipation (int personId, int organizationId, DateTime memberSince, DateTime expires) diff --git a/Common/Constants.cs b/Common/Constants.cs index c84a8774..a129807d 100644 --- a/Common/Constants.cs +++ b/Common/Constants.cs @@ -8,7 +8,7 @@ namespace Swarmops.Common { public class Constants { - // These constants are necessary because MySql keeps vomiting on DateTime.MinValue and DateTime.MaxValue, so we + // These constants are necessary because MySql keeps vomiting on Constants.DateTimeLow and DateTime.MaxValue, so we // need some other definition of endpoints of the valid DateTime space public static DateTime DateTimeLow diff --git a/Console/Console.cs b/Console/Console.cs index 150db791..0f778b6f 100644 --- a/Console/Console.cs +++ b/Console/Console.cs @@ -707,7 +707,7 @@ namespace Swarmops { bool foundActive = false; bool foundMismatch = false; - DateTime expiry = DateTime.MinValue; + DateTime expiry = Constants.DateTimeLow; Participations participations = person.GetMemberships(); @@ -1105,7 +1105,7 @@ namespace Swarmops Person person = membership.Person; Console.Write(person.Name + "... "); - if (person.Birthdate != DateTime.MinValue) + if (person.Birthdate != Constants.DateTimeLow) { Console.WriteLine(person.Birthdate.ToString("yyyy-MMM-dd") + "/" + person.Gender.ToString() + " ok"); } @@ -1144,7 +1144,7 @@ namespace Swarmops catch (Exception) { Console.WriteLine("FAIL"); - //person.Birthdate = DateTime.MinValue; + //person.Birthdate = Constants.DateTimeLow; //person.Gender = PersonGender.Unknown; } diff --git a/Database/Database-PirateWebLog.cs b/Database/Database-PirateWebLog.cs index 16df9729..dfead745 100644 --- a/Database/Database-PirateWebLog.cs +++ b/Database/Database-PirateWebLog.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.Common; +using Swarmops.Common; using Swarmops.Basic.Types; using Swarmops.Basic.Types.System; @@ -57,7 +58,7 @@ namespace Swarmops.Database return reader.GetDateTime (0); } } - return DateTime.MinValue; + return Constants.DateTimeLow; } } } diff --git a/Logic/Cache/GeographyCache.cs b/Logic/Cache/GeographyCache.cs index 90668de1..c08f4b6d 100644 --- a/Logic/Cache/GeographyCache.cs +++ b/Logic/Cache/GeographyCache.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Swarmops.Basic.Types; +using Swarmops.Common; using Swarmops.Basic.Types.Structure; using Swarmops.Database; using Swarmops.Logic.Structure; @@ -17,7 +18,7 @@ namespace Swarmops.Logic.Cache static GeographyCache() { - lastRefresh = DateTime.MinValue; + lastRefresh = Constants.DateTimeLow; } private static Dictionary> GetHashedGeographies() diff --git a/Logic/Cache/GuidCache.cs b/Logic/Cache/GuidCache.cs index a3a46739..afef9f76 100644 --- a/Logic/Cache/GuidCache.cs +++ b/Logic/Cache/GuidCache.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Swarmops.Common; namespace Swarmops.Logic.Cache { @@ -21,7 +22,7 @@ namespace Swarmops.Logic.Cache static GuidCache() { _cache = new Dictionary(); - _nextGarbageCollect = DateTime.MinValue; + _nextGarbageCollect = Constants.DateTimeLow; } public static void Set (string guidString, object objectToCache) diff --git a/Logic/Cache/MailTemplateCache.cs b/Logic/Cache/MailTemplateCache.cs index 45af582b..d2c5060d 100644 --- a/Logic/Cache/MailTemplateCache.cs +++ b/Logic/Cache/MailTemplateCache.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Communications; +using Swarmops.Common; using Swarmops.Database; using Swarmops.Logic.Structure; @@ -9,7 +10,7 @@ namespace Swarmops.Logic.Cache { public class MailTemplateCache { - private static DateTime lastAccess = DateTime.MinValue; + private static DateTime lastAccess = Constants.DateTimeLow; private static readonly object loadCacheLock = new object(); public static bool loadCache = true; @@ -20,7 +21,7 @@ namespace Swarmops.Logic.Cache static MailTemplateCache() { - lastAccess = DateTime.MinValue; + lastAccess = Constants.DateTimeLow; } private static List GetCachedTemplates (string templateName) diff --git a/Logic/Cache/OrganizationCache.cs b/Logic/Cache/OrganizationCache.cs index 061d6958..5390c41a 100644 --- a/Logic/Cache/OrganizationCache.cs +++ b/Logic/Cache/OrganizationCache.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Structure; +using Swarmops.Common; using Swarmops.Database; using Swarmops.Logic.Structure; @@ -18,7 +19,7 @@ namespace Swarmops.Logic.Cache static OrganizationCache() { - lastRefresh = DateTime.MinValue; + lastRefresh = Constants.DateTimeLow; } public static bool needsReload diff --git a/Logic/Communications/OutboundMail.cs b/Logic/Communications/OutboundMail.cs index d2b70507..a2c0b977 100644 --- a/Logic/Communications/OutboundMail.cs +++ b/Logic/Communications/OutboundMail.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Communications; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Common.Interfaces; using Swarmops.Database; @@ -100,8 +101,8 @@ namespace Swarmops.Logic.Communications return FromBasic (new BasicOutboundMail (0, MailAuthorType.Person, author.PersonId, title, body, 99, mailType, organization.Identity, geography.Identity, DateTime.Now, - DateTime.Now, false, false, false, DateTime.MinValue, - DateTime.MinValue, DateTime.MinValue, 0, 0, 0)); + DateTime.Now, false, false, false, Constants.DateTimeLow, + Constants.DateTimeLow, Constants.DateTimeLow, 0, 0, 0)); } /// diff --git a/Logic/Communications/PhoneMessageTransmitter.cs b/Logic/Communications/PhoneMessageTransmitter.cs index 7041da56..b75480a5 100644 --- a/Logic/Communications/PhoneMessageTransmitter.cs +++ b/Logic/Communications/PhoneMessageTransmitter.cs @@ -5,6 +5,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.RegularExpressions; using System.Web; +using Swarmops.Common; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Security; using Swarmops.Database; @@ -15,7 +16,7 @@ namespace Swarmops.Logic.Communications public class PhoneMessageTransmitter { private static ServiceCredential credential; // credentials cache - private static DateTime lastLoad = DateTime.MinValue; + private static DateTime lastLoad = Constants.DateTimeLow; private static readonly object locker = new object(); private static ServiceCredential Credential diff --git a/Logic/Financial/BitcoinUtility.cs b/Logic/Financial/BitcoinUtility.cs index bedc86a5..869996b7 100644 --- a/Logic/Financial/BitcoinUtility.cs +++ b/Logic/Financial/BitcoinUtility.cs @@ -15,6 +15,7 @@ using System.Web; using System.Web.Configuration; using NBitcoin; using Newtonsoft.Json.Linq; +using Swarmops.Common; using Swarmops.Database; using Swarmops.Logic.Communications; using Swarmops.Logic.Communications.Payload; @@ -637,7 +638,7 @@ namespace Swarmops.Logic.Financial } } - private static DateTime _lastFeeRefresh = DateTime.MinValue; + private static DateTime _lastFeeRefresh = Constants.DateTimeLow; private static Int64 _lastFeeSatoshis = 200 * 100; // 0.2 millibitcoins as default fee per 1000 bytes private const Int64 _satoshisPerBitcoin = 100 * 1000 * 1000; // written this way to improve readability - important constants diff --git a/Logic/Financial/ExternalBankData.cs b/Logic/Financial/ExternalBankData.cs index f3d76980..b2af63d5 100644 --- a/Logic/Financial/ExternalBankData.cs +++ b/Logic/Financial/ExternalBankData.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; +using Swarmops.Common; using Swarmops.Logic.Structure; using Swarmops.Logic.Support; @@ -134,7 +135,7 @@ namespace Swarmops.Logic.Financial throw new InvalidOperationException ("Cannot parse transactions file without at least a date field"); } - DateTime dateTime = DateTime.MinValue; + DateTime dateTime = Constants.DateTimeLow; if (fieldNameLookup.ContainsKey (ExternalBankDataFieldName.Date)) { diff --git a/Logic/Financial/FinancialAccount.cs b/Logic/Financial/FinancialAccount.cs index 2f601e7f..a7d12fd4 100644 --- a/Logic/Financial/FinancialAccount.cs +++ b/Logic/Financial/FinancialAccount.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Swarmops.Basic.Types.Financial; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Common.Generics; using Swarmops.Database; @@ -222,7 +223,7 @@ namespace Swarmops.Logic.Financial int testYear = base.OpenedYear; if (testYear < 1900) // not initialized { - DateTime firstTransactionDate = DateTime.MinValue; + DateTime firstTransactionDate = Constants.DateTimeLow; try { firstTransactionDate = diff --git a/Logic/Financial/Payouts.cs b/Logic/Financial/Payouts.cs index a94277c8..7ae9ddcf 100644 --- a/Logic/Financial/Payouts.cs +++ b/Logic/Financial/Payouts.cs @@ -106,7 +106,7 @@ namespace Swarmops.Logic.Financial BasicPayout basicPayout = new BasicPayout (0, organization.Identity, claim.Claimer.BankName, claim.Claimer.BankClearing + " / " + claim.Claimer.BankAccount, string.Empty, 0, - DateTime.MinValue, false, DateTime.Now, 0); + Constants.DateTimeLow, false, DateTime.Now, 0); Payout payout = Payout.FromBasic (basicPayout); payout.RecipientPerson = claim.Claimer; @@ -211,7 +211,7 @@ namespace Swarmops.Logic.Financial BasicPayout basicPayout = new BasicPayout (0, organization.Identity, advance.Person.BankName, advance.Person.BankClearing + " / " + advance.Person.BankAccount, string.Empty, 0, - DateTime.MinValue, false, DateTime.Now, 0); + Constants.DateTimeLow, false, DateTime.Now, 0); Payout payout = Payout.FromBasic (basicPayout); payout.RecipientPerson = advance.Person; diff --git a/Logic/Security/Authentication.cs b/Logic/Security/Authentication.cs index d849b3be..faefbb63 100644 --- a/Logic/Security/Authentication.cs +++ b/Logic/Security/Authentication.cs @@ -6,6 +6,7 @@ using System.Security.Cryptography; using System.Text; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Swarm; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Database; using Swarmops.Logic.Support; @@ -390,7 +391,7 @@ namespace Swarmops.Logic.Security { throw new VerificationTicketWrongException ("No such code exists."); } - DateTime createdTime = DateTime.MinValue; + DateTime createdTime = Constants.DateTimeLow; DateTime.TryParseExact (storedParts[1].Trim(), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out createdTime); diff --git a/Logic/Security/InternalLoginTicket.cs b/Logic/Security/InternalLoginTicket.cs index 50b1fe4d..5869d8b7 100644 --- a/Logic/Security/InternalLoginTicket.cs +++ b/Logic/Security/InternalLoginTicket.cs @@ -1,10 +1,11 @@ using System; +using Swarmops.Common; namespace Swarmops.Logic.Security { public class InternalLoginTicket { - public DateTime created = DateTime.MinValue; + public DateTime created = Constants.DateTimeLow; public int validatedUserID = -1; } } \ No newline at end of file diff --git a/Logic/Special/Sweden/SupportCase.cs b/Logic/Special/Sweden/SupportCase.cs index 8f464c1c..2f88995b 100644 --- a/Logic/Special/Sweden/SupportCase.cs +++ b/Logic/Special/Sweden/SupportCase.cs @@ -1,4 +1,5 @@ using System; +using Swarmops.Common; using Swarmops.Common.Interfaces; namespace Swarmops.Logic.Special.Sweden @@ -16,7 +17,7 @@ namespace Swarmops.Logic.Special.Sweden this.SupportCaseId = identity; this.Title = title; this.Open = false; - this.DateTimeClosed = DateTime.MinValue; + this.DateTimeClosed = Constants.DateTimeLow; this.Email = string.Empty; } diff --git a/Logic/Swarm/MembershipEvent.cs b/Logic/Swarm/MembershipEvent.cs index e845d28c..95aca2b8 100644 --- a/Logic/Swarm/MembershipEvent.cs +++ b/Logic/Swarm/MembershipEvent.cs @@ -1,4 +1,5 @@ using System; +using Swarmops.Common; using Swarmops.Common.Enums; namespace Swarmops.Logic.Swarm @@ -16,7 +17,7 @@ namespace Swarmops.Logic.Swarm public MembershipEvent() { - this.DateTime = DateTime.MinValue; + this.DateTime = Constants.DateTimeLow; this.DeltaCount = 0; this.PersonId = 0; this.OrganizationId = 0; diff --git a/Logic/Swarm/Person.cs b/Logic/Swarm/Person.cs index 9335d7de..1bb8a881 100644 --- a/Logic/Swarm/Person.cs +++ b/Logic/Swarm/Person.cs @@ -9,6 +9,7 @@ using NBitcoin; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Structure; using Swarmops.Basic.Types.Swarm; +using Swarmops.Common; using Swarmops.Common.Attributes; using Swarmops.Common.Enums; using Swarmops.Common.Interfaces; @@ -609,7 +610,7 @@ namespace Swarmops.Logic.Swarm { return FromBasic (new BasicPerson (personId, string.Empty, "Open Ledgers", string.Empty, string.Empty, - string.Empty, string.Empty, 0, string.Empty, 0, DateTime.MinValue, PersonGender.Unknown, "")); + string.Empty, string.Empty, 0, string.Empty, 0, Constants.DateTimeLow, PersonGender.Unknown, "")); } throw new ArgumentException("No such PersonId: " + personId); diff --git a/Logic/Swarm/PersonQuarantine.cs b/Logic/Swarm/PersonQuarantine.cs index 6bf9013d..9451e1dd 100644 --- a/Logic/Swarm/PersonQuarantine.cs +++ b/Logic/Swarm/PersonQuarantine.cs @@ -4,6 +4,7 @@ using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Logic.Support; @@ -29,7 +30,7 @@ namespace Swarmops.Logic.Swarm } else { - return DateTime.MinValue; // no quarantine active + return Constants.DateTimeLow; // no quarantine active } } } diff --git a/Logic/Swarm/Volunteer.cs b/Logic/Swarm/Volunteer.cs index f14fd337..6b99a22e 100644 --- a/Logic/Swarm/Volunteer.cs +++ b/Logic/Swarm/Volunteer.cs @@ -1,6 +1,7 @@ using System; using Swarmops.Basic.Types; using Swarmops.Basic.Types.Swarm; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Database; using Swarmops.Logic.Structure; @@ -13,7 +14,7 @@ namespace Swarmops.Logic.Swarm #region Creation and Construction private Volunteer() - : base (0, 0, 0, DateTime.MinValue, false, DateTime.MinValue, string.Empty) + : base (0, 0, 0, Constants.DateTimeLow, false, Constants.DateTimeLow, string.Empty) { } diff --git a/Site/Bases/MasterV5Base.cs b/Site/Bases/MasterV5Base.cs index 04c8ccef..2cdb3c6d 100644 --- a/Site/Bases/MasterV5Base.cs +++ b/Site/Bases/MasterV5Base.cs @@ -1,5 +1,6 @@ using System; using System.Web.UI; +using Swarmops.Common; using Swarmops.Logic.Security; using Swarmops.Logic.Structure; using Swarmops.Logic.Swarm; @@ -43,7 +44,7 @@ namespace Swarmops.Frontend { return new DateTime ((long) Session["MainMenu-v5_Enabling_TimeStamp"]); } - return DateTime.MinValue; + return Constants.DateTimeLow; } set { Session["MainMenu-v5_Enabling_TimeStamp"] = value.Ticks; } } diff --git a/Site/Pages/v5/Ledgers/Json-OutstandingAccounts.aspx.cs b/Site/Pages/v5/Ledgers/Json-OutstandingAccounts.aspx.cs index bcfd4dfb..547e94e7 100644 --- a/Site/Pages/v5/Ledgers/Json-OutstandingAccounts.aspx.cs +++ b/Site/Pages/v5/Ledgers/Json-OutstandingAccounts.aspx.cs @@ -93,7 +93,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers foreach (ExpenseClaim claim in claims) { - outstandingAccounts.Add (OutstandingAccount.FromExpenseClaim (claim, DateTime.MinValue)); + outstandingAccounts.Add (OutstandingAccount.FromExpenseClaim (claim, Constants.DateTimeLow)); } foreach (Payout payout in payouts) { @@ -143,7 +143,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers // whetherthe transaction's date is on the other side of targetDateTime. bool includeThisClaim = false; - DateTime dateTimeClosed = DateTime.MinValue; + DateTime dateTimeClosed = Constants.DateTimeLow; if (claim.Open) { diff --git a/Site/Pages/v5/Ledgers/ResyncExternalAccount.aspx.cs b/Site/Pages/v5/Ledgers/ResyncExternalAccount.aspx.cs index 9b268e94..1ec9c35a 100644 --- a/Site/Pages/v5/Ledgers/ResyncExternalAccount.aspx.cs +++ b/Site/Pages/v5/Ledgers/ResyncExternalAccount.aspx.cs @@ -10,6 +10,7 @@ using System.Web; using System.Web.Services; using System.Web.UI.WebControls; using Resources; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Common.Interfaces; using Swarmops.Logic.Financial; @@ -353,7 +354,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers // our own for this timestamp. There may be several transactions in the master file, but at least one should have // a post-transaction balance that matches our records, or something is much more broken. - long swarmopsCentsStart = account.GetDeltaCents (DateTime.MinValue, timeWalker.AddSeconds (1)); + long swarmopsCentsStart = account.GetDeltaCents (Constants.DateTimeLow, timeWalker.AddSeconds (1)); // At least one of the transactions for this timestamp should match. diff --git a/Site/Pages/v5/Ledgers/UploadBankFiles.aspx.cs b/Site/Pages/v5/Ledgers/UploadBankFiles.aspx.cs index 2b490468..593bd276 100644 --- a/Site/Pages/v5/Ledgers/UploadBankFiles.aspx.cs +++ b/Site/Pages/v5/Ledgers/UploadBankFiles.aspx.cs @@ -753,7 +753,7 @@ namespace Swarmops.Site.Pages.Ledgers string[] lines = contents.Split ('\n'); - DateTime timestamp = DateTime.MinValue; + DateTime timestamp = Constants.DateTimeLow; int bgMaxVersion = 0; ImportedPaymentData result = new ImportedPaymentData(); diff --git a/Utility/BotCode/HeartBeater.cs b/Utility/BotCode/HeartBeater.cs index 3fbe2b6d..1328a030 100644 --- a/Utility/BotCode/HeartBeater.cs +++ b/Utility/BotCode/HeartBeater.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Text; +using Swarmops.Common; using Swarmops.Logic.Support; namespace Swarmops.Utility.BotCode @@ -11,7 +12,7 @@ namespace Swarmops.Utility.BotCode private static readonly object lockObject = new object(); private bool FlagRestartRequested; - private DateTime lastBeat = DateTime.MinValue; + private DateTime lastBeat = Constants.DateTimeLow; private string lastFilename = ""; public bool WasKilled diff --git a/Utility/BotCode/NewsletterChecker.cs b/Utility/BotCode/NewsletterChecker.cs index fa7ca5c6..349aa963 100644 --- a/Utility/BotCode/NewsletterChecker.cs +++ b/Utility/BotCode/NewsletterChecker.cs @@ -55,7 +55,7 @@ namespace Swarmops.Utility.BotCode RssReader reader = new RssReader(readerFeedUrl); People recipients = null; - DateTime highWaterMark = DateTime.MinValue; + DateTime highWaterMark = Constants.DateTimeLow; string persistenceKey = "Newsletter-Highwater-" + personId.ToString(); string highWaterMarkString = Persistence.Key[persistenceKey]; @@ -66,7 +66,7 @@ namespace Swarmops.Utility.BotCode } catch (FormatException) { - highWaterMark = DateTime.MinValue; + highWaterMark = Constants.DateTimeLow; } catch (Exception e) { diff --git a/Utility/BotCode/PressReleaseChecker.cs b/Utility/BotCode/PressReleaseChecker.cs index 6fed06fd..38cc4fb2 100644 --- a/Utility/BotCode/PressReleaseChecker.cs +++ b/Utility/BotCode/PressReleaseChecker.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using NRss; +using Swarmops.Common; using Swarmops.Common.Enums; using Swarmops.Logic.Communications; using Swarmops.Logic.Media; @@ -30,7 +31,7 @@ namespace Swarmops.Utility.BotCode { string persistenceKey = String.Format ("Pressrelease-Highwater-{0}", persistAsKey); - DateTime highWaterMark = DateTime.MinValue; + DateTime highWaterMark = Constants.DateTimeLow; RssReader reader = null; diff --git a/Utility/Communications/CommsTransmitterMail.cs b/Utility/Communications/CommsTransmitterMail.cs index c0f5e90a..485a479d 100644 --- a/Utility/Communications/CommsTransmitterMail.cs +++ b/Utility/Communications/CommsTransmitterMail.cs @@ -4,6 +4,7 @@ using System.Net.Mail; using System.Reflection; using System.Text; using System.Threading; +using Swarmops.Common; using Swarmops.Logic.Communications; using Swarmops.Logic.Communications.Payload; using Swarmops.Logic.Support; @@ -20,7 +21,7 @@ namespace Swarmops.Utility.Communications private static int _smtpPortCache = 25; private static string _smtpUserCache = string.Empty; private static string _smtpPasswordCache = string.Empty; - private static DateTime _cacheReloadTime = DateTime.MinValue; + private static DateTime _cacheReloadTime = Constants.DateTimeLow; public void Transmit (PayloadEnvelope envelope, Person person) { @@ -76,7 +77,7 @@ namespace Swarmops.Utility.Communications { // Address failure -- either sender or recipient - _cacheReloadTime = DateTime.MinValue; + _cacheReloadTime = Constants.DateTimeLow; throw new OutboundCommTransmitException ("Cannot send mail to " + person.Mail, e); } @@ -111,7 +112,7 @@ namespace Swarmops.Utility.Communications smtpServer = "localhost"; smtpPort = 25; // For development use only - invalidate cache instead of this, forcing re-reload - _cacheReloadTime = DateTime.MinValue; + _cacheReloadTime = Constants.DateTimeLow; } SmtpClient mailClient = new SmtpClient (smtpServer, smtpPort); @@ -126,7 +127,7 @@ namespace Swarmops.Utility.Communications } catch (Exception e) { - _cacheReloadTime = DateTime.MinValue; + _cacheReloadTime = Constants.DateTimeLow; throw new OutboundCommTransmitException ("Cannot send mail to " + person.Mail, e); } }