- mullivan.sharepoint.zip
- Build
- Features
- AdUserInfoUpdate
- Reminder
- gacutil.exe
- Images
- ReminderSettings.gif
- Layouts
- Mullivan.Extensibility.dll
- Mullivan.Extensibility.dll.config
- Mullivan.Extensibility.pdb
- Mullivan.Shared.dll
- Mullivan.Shared.pdb
- Mullivan.SharePoint.dll
- Mullivan.SharePoint.Pages.dll
- Mullivan.SharePoint.Pages.pdb
- Mullivan.SharePoint.pdb
- Mullivan.SharePoint.Reminders.dll
- Mullivan.SharePoint.Reminders.pdb
- Mullivan.SharePoint.Remote.dll
- Mullivan.SharePoint.Remote.dll.config
- Mullivan.SharePoint.Remote.pdb
- Mullivan.SharePoint.WebParts.dll
- Mullivan.SharePoint.WebParts.pdb
- Update SharePoint.bat
- WebpartFiles
- LibraryNavigationWebPart.webpart
- ListQueryResultsWebPart.webpart
- ListQueryWebPart.webpart
- MostViewedWebPart.webpart
- WeatherWebPart.webpart
- Mullivan.Shared
- Collections
- Generic
- Cryptography
- Logging
- Mullivan.Shared.csproj
- Mullivan.Shared.csproj.user
- Mullivan.snk
- Properties
- Security
- Serialization
- Mullivan.SharePoint.Pages
- Mullivan.SharePoint.Reminders
- Mullivan.SharePoint.Remote
- Mullivan.SharePoint.sln
- Mullivan.SharePoint.WebParts
- Mullivan.SharePoint
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Mullivan.SharePoint.Reminders
{
public class RmdMonthlyRecurrence : RmdRecurrence
{
public override string Name
{
get { return "Monthly"; }
}
public int StartDay
{
get;
set;
}
public int StartHour
{
get;
set;
}
public override bool CanRun(DateTime lastRun)
{
DateTime dtNow = DateTime.Now;
int totalDaysInMonth = DateTime.DaysInMonth(lastRun.Year, lastRun.Month);
int startDay = this.StartDay;
if(startDay > totalDaysInMonth)
startDay = totalDaysInMonth;
//If never run then run
if (lastRun.Equals(DateTime.MinValue))
return true;
DateTime nextOccurence = new DateTime(lastRun.Year, lastRun.Month, startDay, this.StartHour, 0, 0);
//If lastRun is already greater than the next occurence
// then we need to increment to the next month
if (lastRun > nextOccurence)
{
//Increment by one month
int month = lastRun.Month + 1;
int year = lastRun.Year;
//If month is over 12 then we need to change the year and set the month
// back to january
if (month > 12)
{
month = 1;
year++;
}
startDay = this.StartDay;
totalDaysInMonth = DateTime.DaysInMonth(year, month);
if (startDay > totalDaysInMonth)
startDay = totalDaysInMonth;
nextOccurence = new DateTime(year, month, startDay, this.StartHour, 0, 0);
}
if (dtNow > nextOccurence)
return true;
return false;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.