Beispiel #1
0
 private void bgw_EndOfMonthOperations_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     try
     {
         var settings = _SettingsRepo.GetConfig();
         if (settings.AllowReminderForClosingMonth)
         {
             AllowNonFlexibleClosingOfMonthOperation(settings);
         }
         if (settings.AllowFlexibleClosingOfMonth)
         {
             if (!_TransactionRepo.HasMonthBeenClosed(DateTime.Now.Month - 1))
             {
                 AllowFlexibleClosingOfMonthOperation(settings);
             }
         }
         else
         {
             if (!_TransactionRepo.HasMonthBeenClosed(DateTime.Now.Month - 1))
             {
                 var previousMonthName = GetMonthName(DateTime.Now.Month - 1);
                 ForcefullyCloseMonth(settings, previousMonthName);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show($"{ERRORMESSAGE} \n Error details: {ex.Message}", "Superior Investment!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 private void CreditCustomer_Load(object sender, EventArgs e)
 {
     Cursor.Current             = Cursors.WaitCursor;
     txt_AccountNumber.ReadOnly = true; txt_Commission.ReadOnly = true;
     txt_TotalDebt.ReadOnly     = true; txt_TotalCredit.ReadOnly = true;
     if (_TransactionRepo.HasMonthBeenClosed(DateTime.Now.Month))
     {
         txt_AmountContributed.Enabled = false; cmb_Customers.Enabled = false;
         btn_Credit.Enabled            = false;
     }
     else
     {
         txt_AmountContributed.Enabled = true; cmb_Customers.Enabled = true;
         btn_Credit.Enabled            = true;
         if (!bgwGetCustomers.IsBusy)
         {
             bgwGetCustomers.RunWorkerAsync();
         }
     }
 }