Exemple #1
0
        /// <summary>
        /// Performs business logic actions specified for this task handler.
        /// </summary>
        protected override void PerformActions()
        {
            ClearTemporaryDocumentMedia();

            DateTime dateToConsider = Utils.Today.Date;
            TimeSpan ts;

            if (TimeSpan.TryParse(Utils.GetSystemValue("AgentExecutionTime"), out ts))
            {
                if (Utils.Now < (Utils.Today + ts))
                {
                    dateToConsider = dateToConsider.AddDays(-1);
                }
            }
            ProjectUsageHandler.CreatePaymentSummaries(dateToConsider);
            //Monthly retry process with in the Graceperiod
            ProjectFinanceHandler.ProcessInvoicesAndPayments(0, dateToConsider, false, 0);

            // Run CompanyStatusHandler and  ProjectStatusHandler in same datacontext
            using (StageBitzDB dataContext = new StageBitzDB())
            {
                ProjectStatusHandler.UpdateProjectExpirations(dateToConsider, dataContext);
                CompanyStatusHandler.UpdateCompanyExpirations(dateToConsider, dataContext);

                dataContext.SaveChanges();
            }

            CompanyStatusHandler.SuspendNoPaymentOptionCompanies(dateToConsider);

            SendUserEmailNotifications(dateToConsider);
            SendBookingNotifications();
            SendBookingOverdueAndDelayedEmails(dateToConsider.AddDays(1));
            DeleteOldExportedZipFiles();
        }
Exemple #2
0
        /// <summary>
        /// Performs business logic actions specified for this task handler.
        /// </summary>
        protected override void PerformActions()
        {
            int      dayToRun       = int.Parse(Utils.GetSystemValue("MonthlyFinanceProcessDay"));
            DateTime dateToConsider = new DateTime(Utils.Today.Year, Utils.Today.Month, dayToRun);
            TimeSpan ts;

            if (TimeSpan.TryParse(Utils.GetSystemValue("AgentExecutionTime"), out ts))
            {
                if (Utils.Now < dateToConsider + ts)
                {
                    dateToConsider = dateToConsider.AddMonths(-1);
                }
            }
            ProjectFinanceHandler.ProcessInvoicesAndPayments(0, dateToConsider, true, 0);
        }
Exemple #3
0
 /// <summary>
 /// Makes the payment.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="CommandEventArgs"/> instance containing the event data.</param>
 protected void MakePayment(object sender, CommandEventArgs e)
 {
     if (!StopProcessing)
     {
         popupMakePayment.HidePopup();
         //Make the payment
         bool isPaymentSuccess = ProjectFinanceHandler.ProcessInvoicesAndPayments(CompanyId, Today, false, UserID);
         if (!isPaymentSuccess)
         {
             popupNotification.Title = "Payment failed";
             ltrlNotification.Text   = "Payment failed. Please verify the payment details and retry.";
             popupNotification.ShowPopup();
             return;
         }
         //Refresh the UI
         Response.Redirect(Request.Url.ToString());
     }
 }