Пример #1
0
        public ActionResult BillingStatmentIndex_PublicMode3(int id, string StatementDate) //id = BillingContactID
        {
            //Mode3

            // if (!Security.UserCanAccessBillingContact(m_UserID, id))
            // {
            //     return RedirectToAction("Index", "Home");
            // }

            int BillingContactID = id;

            DateTime StartDate, EndDate;

            EndDate   = Convert.ToDateTime(StatementDate);
            StartDate = new DateTime(EndDate.AddMonths(-1).Year, EndDate.AddMonths(-1).Month, 2);

            //StartDate = new DateTime(2010,8,2);
            //EndDate = new DateTime(2010,9,1);

            BillingStatement_Index viewBillingStatement_Index = new BillingStatement_Index();

            viewBillingStatement_Index.BillingContactID = BillingContactID;
            viewBillingStatement_Index.ClientView       = true;
            viewBillingStatement_Index.BillingStatement =
                BillingStatements.GetCurrentBillingStatement(BillingContactID, StartDate, EndDate);

            viewBillingStatement_Index.StatementDate = EndDate;
            viewBillingStatement_Index.toPrint       = true;

            return(View("BillingStatmentIndex_Public", "Print", viewBillingStatement_Index));
        }
Пример #2
0
        internal void SetRange(string range)
        {
            switch (range)
            {
            case "OneMonth":
                StartDate = EndDate.AddMonths(-1);
                break;

            case "ThreeMonth":
                StartDate = EndDate.AddMonths(-3);

                break;

            case "SixMonth":
                StartDate = EndDate.AddMonths(-6);
                break;

            case "YTD":
                int count    = StockPriceDetails.Count;
                var dateTime = StockPriceDetails[count - 1].Date;
                EndDate   = dateTime;
                StartDate = new DateTime(dateTime.Year, 1, 1);
                break;

            case "OneYear":
                StartDate = EndDate.AddYears(-1);
                break;

            default:
                int count2 = StockPriceDetails.Count;
                StartDate = StockPriceDetails[0].Date;
                EndDate   = StockPriceDetails[count2 - 1].Date;
                break;
            }
        }
Пример #3
0
        public MonthlyInterval(DateTime startDate, int endDay) : base(Period.Monthly)
        {
            var endDateAtEndOfMonth = false;

            EndDay = endDay;
            if (EndDay == -1 || EndDay > 30)
            {
                endDateAtEndOfMonth = true;
            }

            if (endDateAtEndOfMonth)
            {
                EndDate = new DateTime(startDate.Year, startDate.Month, DateTime.DaysInMonth(startDate.Year, startDate.Month));
            }
            else
            {
                var tmp = (endDay < startDate.Day)
                    ? startDate.AddMonths(1)
                    : startDate;

                EndDate = new DateTime(tmp.Year, tmp.Month, Math.Min(endDay, DateTime.DaysInMonth(tmp.Year, tmp.Month)));
            }
            if (!endDateAtEndOfMonth)
            {
                StartDate = EndDate.AddMonths(-1).AddDays(1);
            }
            else
            {
                StartDate = EndDate.AddDays(1).AddMonths(-1);
            }
        }
Пример #4
0
        private void SetWorkingDaysCount()
        {
            DateTime date_to = new DateTime(EndDate.Year, EndDate.AddMonths(1).Month, 1).AddDays(-1); //end of the specified month

            WorkingDaysTotal     = DateHelper.WorkingDaysInMonth(EndDate);
            WorkingDaysCompleted = DateHelper.WorkingDaysInMonthUntilDate(EndDate);
            WorkingDaysRemaining = WorkingDaysTotal - WorkingDaysCompleted;
        }
Пример #5
0
 void UpdateStartEndDates()
 {
     periodChangeLock = true;
     EndDate          = DateTime.Now;
     periodChangeLock = false;
     StartDate        = EndDate.AddMonths(-Period);
     UpdateGridCaption();
 }
Пример #6
0
            public NextOccurance NextMonth(int day)
            {
                var nextMonth = new NextOccurance {
                    StartDate = StartDate.AddMonths(1), EndDate = EndDate.AddMonths(1)
                };

                nextMonth.Tally(day);
                return(nextMonth);
            }
Пример #7
0
 public void MakePayment(decimal amount)
 {
     RemainingCost -= amount;
     if (RemainingCost <= 0)
     {
         EndDate = EndDate.AddMonths(MembershipLength);
         if (RemainingCost < 0)
         {
             decimal remainder = Math.Abs(RemainingCost);
             RemainingCost = Cost;
             MakePayment(remainder);
         }
         else
         {
             RemainingCost = Cost;
         }
     }
 }