Skip to content

Commit 56a03bb

Browse files
committed
Resolve refactoring errors. Renamed DataAccess folder to Repositories.
1 parent 7ebdf88 commit 56a03bb

File tree

84 files changed

+650
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+650
-541
lines changed

Lab Billing UI/Forms/AccountForm.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private async Task LoadAccountData()
316316

317317
if (closing)
318318
return;
319-
319+
Cursor.Current = Cursors.WaitCursor;
320320
this.SuspendLayout();
321321
try
322322
{
@@ -362,6 +362,7 @@ private async Task LoadAccountData()
362362
}
363363

364364
this.ResumeLayout();
365+
Cursor.Current = Cursors.Default;
365366
}
366367

367368
/// <summary>
@@ -616,7 +617,7 @@ private void SaveDemographics_Click(object sender, EventArgs e)
616617
currentAccount.Pat.ZipCode = ZipcodeTextBox.Text;
617618
currentAccount.Pat.CityStateZip = $"{CityTextBox.Text}, {StateComboBox.SelectedValue} {ZipcodeTextBox.Text}";
618619
currentAccount.Pat.PatFullName = $"{LastNameTextBox.Text},{FirstNameTextBox.Text} {MiddleNameTextBox.Text}";
619-
currentAccount.Pat.ProviderId = orderingPhyTextBox.Tag.ToString();
620+
currentAccount.Pat.ProviderId = orderingPhyTextBox.Tag?.ToString();
620621

621622
currentAccount.Pat.GuarantorFullName = $"{GuarantorLastNameTextBox.Text} {GuarSuffixTextBox.Text},{GuarFirstNameTextBox.Text} {GuarMiddleNameTextBox.Text}";
622623
currentAccount.Pat.GuarantorLastName = GuarantorLastNameTextBox.Text;
@@ -1451,8 +1452,10 @@ private async void ValidateAccountButton_Click(object sender, EventArgs e)
14511452
{
14521453
try
14531454
{
1455+
Cursor.Current = Cursors.WaitCursor;
14541456
currentAccount = await accountService.ValidateAsync(currentAccount);
14551457
RefreshAccountData();
1458+
Cursor.Current = Cursors.Default;
14561459
}
14571460
catch (Exception ex)
14581461
{
@@ -1527,7 +1530,6 @@ private void statementFlagComboBox_SelectionChangeCommitted(object sender, Event
15271530
{
15281531
currentAccount = accountService.UpdateStatementFlag(currentAccount, statementFlagComboBox.SelectedItem.ToString());
15291532
RefreshAccountData();
1530-
//await LoadAccountData();
15311533
}
15321534

15331535
private async void moveAllChargesToolStripMenuItem_Click(object sender, EventArgs e)
@@ -1542,6 +1544,7 @@ private async void moveAllChargesToolStripMenuItem_Click(object sender, EventArg
15421544
if (MessageBox.Show($"Move all charges to account {destAccount}?",
15431545
"Confirm Move", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
15441546
{
1547+
Cursor.Current = Cursors.WaitCursor;
15451548
Log.Instance.Debug($"Moving all charges from {currentAccount.AccountNo} to {destAccount}");
15461549
var (isSuccess, error) = accountService.MoveCharges(currentAccount.AccountNo, destAccount);
15471550
if (!isSuccess)
@@ -1550,6 +1553,8 @@ private async void moveAllChargesToolStripMenuItem_Click(object sender, EventArg
15501553
}
15511554

15521555
await LoadAccountData();
1556+
1557+
Cursor.Current = Cursors.Default;
15531558
}
15541559
}
15551560
}
@@ -1569,12 +1574,13 @@ private async void readyToBillCheckbox_CheckedChanged(object sender, EventArgs e
15691574
{
15701575
if (!billingTabLoading)
15711576
{
1577+
Cursor.Current = Cursors.WaitCursor;
15721578
currentAccount.ReadyToBill = readyToBillCheckbox.Checked;
15731579
accountService.UpdateStatus(currentAccount.AccountNo, currentAccount.Status);
1574-
accountService.AddNote(currentAccount.AccountNo, "Marked ready to bill.");
1580+
currentAccount.Notes = accountService.AddNote(currentAccount.AccountNo, "Marked ready to bill.").ToList();
15751581
currentAccount = await accountService.ValidateAsync(currentAccount);
1576-
//await LoadAccountData();
15771582
RefreshAccountData();
1583+
Cursor.Current = Cursors.Default;
15781584
}
15791585
}
15801586

@@ -1623,7 +1629,6 @@ private void clearClaimStatusButton_Click(object sender, EventArgs e)
16231629
{
16241630
currentAccount = accountService.ClearClaimStatus(currentAccount);
16251631
RefreshAccountData();
1626-
//await LoadAccountData();
16271632
}
16281633
}
16291634

Lab Billing UI/Forms/ChargeEntryForm.Designer.cs

Lines changed: 198 additions & 187 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lab Billing UI/Forms/ChargeEntryForm.cs

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ namespace LabBilling.Forms
1111
{
1212
public partial class ChargeEntryForm : BaseForm
1313
{
14-
private Account _currentAccount = new();
15-
private Timer _timer;
14+
private readonly Account _currentAccount = new();
15+
private readonly Timer _timer;
1616
private const int _timerInterval = 650;
17-
private AccountService accountService;
18-
private DictionaryService dictionaryService;
17+
private readonly AccountService accountService;
18+
private readonly DictionaryService dictionaryService;
19+
20+
21+
public string SelectedCdm { get; set; }
22+
public decimal Quantity { get; set; }
23+
public double Amount { get; set; }
24+
public string Comment { get; set; }
25+
public string ReferenceNumber { get; set; }
1926

2027
public ChargeEntryForm(Account currentAccount)
2128
{
@@ -24,7 +31,6 @@ public ChargeEntryForm(Account currentAccount)
2431
InitializeComponent();
2532
_timer = new Timer() { Enabled = false, Interval = _timerInterval };
2633
_timer.Tick += new EventHandler(cdmTextBox_KeyUpDone);
27-
accountService = new(Program.AppEnvironment);
2834
dictionaryService = new(Program.AppEnvironment);
2935
}
3036

@@ -41,38 +47,15 @@ private void btnSubmit_Click(object sender, EventArgs e)
4147
{
4248
Log.Instance.Trace($"Entering");
4349

44-
try
45-
{
46-
string cdm = "";
47-
48-
cdm = cdmTextBox.Text;
49-
50-
if(string.IsNullOrEmpty(cdm))
51-
{
52-
MessageBox.Show("Please select a charge item.", "Incomplete request", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
53-
return;
54-
}
50+
SelectedCdm = cdmTextBox.Text;
51+
Quantity = quantityNumericUpDown.Value;
52+
ReferenceNumber = ReferenceNumberTextBox.Text;
53+
Comment = commentTextBox.Text;
54+
Amount = Convert.ToDouble(string.IsNullOrEmpty(amountTextBox.Text) ? "0.00" : amountTextBox.Text);
5555

56-
accountService.AddCharge(_currentAccount.AccountNo,
57-
cdm,
58-
Convert.ToInt32(nQty.Value),
59-
_currentAccount.TransactionDate,
60-
tbComment.Text,
61-
ReferenceNumber.Text,
62-
Convert.ToDouble(!string.IsNullOrWhiteSpace(amountTextBox.Text) ? amountTextBox.Text : "0.00"));
63-
}
64-
catch(CdmNotFoundException)
65-
{
66-
// this should not happen
67-
MessageBox.Show("CDM number is not valid. Charge entry failed.");
68-
}
69-
catch(AccountNotFoundException)
56+
if (string.IsNullOrEmpty(SelectedCdm))
7057
{
71-
MessageBox.Show("Account number is not valid.");
72-
}
73-
catch(Exception ex)
74-
{
75-
MessageBox.Show(ex.Message + "\nCharge not written.","Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
58+
MessageBox.Show("Please select a charge item.", "Incomplete request", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
7659
return;
7760
}
7861

@@ -87,7 +70,7 @@ private void btnCancel_Click(object sender, EventArgs e)
8770
return;
8871
}
8972

90-
private void SearchByCheckChanged (object sender, EventArgs e)
73+
private void SearchByCheckChanged(object sender, EventArgs e)
9174
{
9275

9376
}
@@ -101,16 +84,18 @@ private void cdmTextBox_KeyUp(object sender, KeyEventArgs e)
10184
private void cdmTextBox_KeyUpDone(object sender, EventArgs e)
10285
{
10386
_timer.Stop();
104-
var cdmLookup = new CdmLookupForm();
105-
cdmLookup.InitialSearchText = cdmTextBox.Text;
106-
cdmLookup.Datasource = dictionaryService.GetAllCdms(false);
87+
var cdmLookup = new CdmLookupForm
88+
{
89+
InitialSearchText = cdmTextBox.Text,
90+
Datasource = dictionaryService.GetAllCdms(false)
91+
};
10792

108-
if(cdmLookup.ShowDialog() == DialogResult.OK)
93+
if (cdmLookup.ShowDialog() == DialogResult.OK)
10994
{
11095
//if cdm is a variable type, ask for amount
11196
cdmTextBox.Text = cdmLookup.SelectedValue;
11297
Cdm cdm = dictionaryService.GetCdm(cdmLookup.SelectedValue);
113-
if(cdm.Variable)
98+
if (cdm.Variable)
11499
{
115100
var result = GetAmount();
116101
if (result.ReturnCode == DialogResult.OK)

Lab Billing UI/Forms/ChargeEntryForm.resx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
3+
<!--
44
Microsoft ResX Schema
5-
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
5151
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->

0 commit comments

Comments
 (0)