Exemple #1
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (!CheckBeginDateTime())
            {
                return;
            }
            //If the AvaTax API is not available at HQ show popup and return.
            if (AvaTax.IsEnabled() && !AvaTax.PingAvaTax())
            {
                MsgBox.Show(this, "Unable to connect to AvaTax API.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            RepeatChargeResult result  = RepeatCharges.RunRepeatingCharges(MiscData.GetNowDateTime(), checkRunAging.Checked);
            string             metrics = result.ProceduresAddedCount + " " + Lan.g(this, "procedures added.") + "\r\n" + result.ClaimsAddedCount + " "
                                         + Lan.g(this, "claims added.");

            SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool ran.\r\n" + metrics);
            Cursor = Cursors.Default;
            MessageBox.Show(metrics);
            if (!string.IsNullOrEmpty(result.ErrorMsg))
            {
                SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool Error: " + result.ErrorMsg);
                MessageBox.Show(result.ErrorMsg);
            }
            DialogResult = DialogResult.OK;
        }
Exemple #2
0
        private void butOK_Click(object sender, EventArgs e)
        {
            Prefs.RefreshCache();            //Just to be sure we don't miss someone who has just started running repeating charges.
            if (PrefC.GetString(PrefName.RepeatingChargesBeginDateTime) != "")
            {
                MsgBox.Show(this, "Repeating charges already running on another workstation, you must wait for them to finish before continuing.");
                return;
            }
            RepeatChargeResult result = RepeatCharges.RunRepeatingCharges(MiscData.GetNowDateTime());

            SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool ran.");
            MessageBox.Show(result.ProceduresAddedCount + " " + Lan.g(this, "procedures added.") + "\r\n" + result.ClaimsAddedCount + " "
                            + Lan.g(this, "claims added."));
            DialogResult = DialogResult.OK;
        }
Exemple #3
0
 ///<summary>Do not use this method in release code. This is only to be used for Unit Tests 53-56.</summary>
 public void RunRepeatingChargesForUnitTests(DateTime dateRun)
 {
     RepeatCharges.RunRepeatingCharges(dateRun);
 }