本文整理匯總了C#中System.UInt32.Day方法的典型用法代碼示例。如果您正苦於以下問題:C# UInt32.Day方法的具體用法?C# UInt32.Day怎麽用?C# UInt32.Day使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.UInt32
的用法示例。
在下文中一共展示了UInt32.Day方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Run
private void Run(JulianDay startDate, JulianDay endDate, BackgroundWorker worker, DoWorkEventArgs e)
{
JulianDay profileStartDate = App.Model.ProfileHolder.Profile.StartProfileDate.JulianDay;
JulianDay profileEndDate = App.Model.ProfileHolder.Profile.EndProfileDate.JulianDay;
// profileStartDate and profileEndDate could be 0
if (startDate == 0 && endDate == 0)
{
startDate = profileStartDate;
endDate = profileEndDate;
}
// Clip the passed start date to the document start date
if (startDate < profileStartDate)
startDate = profileStartDate;
// Always run to the end of the document since changes ripple to the end
endDate = profileEndDate;
// From the start date forward, truncate the daily balances
// Don't leave before doing this!
_Accounts.TruncateBalance(startDate);
_Categories.TruncateBalance(startDate);
// If Dates were never set or nothing to do
if ((profileStartDate == 0 && profileEndDate == 0) || startDate > profileEndDate)
{
UpdateBalances(worker, e);
return;
}
#if NOTUSED
Helper.Trace("Calculating account values between {0,2:d2}/{1,2:d2}/{2,2:d2} and {3,2:d2}/{4,2:d2}/{5,2:d2}",
startDate.Month(), startDate.Day(), startDate.Year(), endDate.Month(), endDate.Day(), endDate.Year());
DateTime SystemTime = DateTime.Now;
Helper.Trace("Start: {0,2:d2}:{1,2:d2}:{2,2:d2}:{3,2:d2}", SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.Millisecond);
#endif
// Let the packages know we are about to run
IncomeBalances.Clear();
SpendingBalances.Clear();
_Incomes.RunPrepare(this);
_Packages.RunPrepare(this);
// Loop thru all the dates in the running date range
for (JulianDay date = startDate; date <= endDate; date++)
{
if (worker != null && worker.CancellationPending)
{
e.Cancel = true;
return;
}
// Run the packages for the given date
_Incomes.Run(this, date);
_Packages.Run(this, date);
// At the end of each day, handle any negative account balances by putting them on the credit account
_Accounts.BorrowFromCredit(this, date);
// At the end of each month, make credit payments if needed
JulianDay tomorrow = date + 1;
bool bMonthlyRun = (tomorrow.Day() == 1);
if (bMonthlyRun)
_Accounts.PayoffCredit(this, date);
}
// Update the RunCount for anyone listening
RunCount++;
UpdateBalances(worker, e);
#if NOTUSED
SystemTime = DateTime.Now;
Helper.Trace("End: {0,2:d2}:{1,2:d2}:{2,2:d2}:{3,2:d2}", SystemTime.Hour, SystemTime.Minute, SystemTime.Second, SystemTime.Millisecond);
#endif
}