I am adding the "Procs" class as a List item:
public static List<Procs> allprocs = new List<Procs>();
So when a user fills out a form and clicks "Add Proceedure":
private void btAddProcedure_Click(object sender, EventArgs e)
{
ClaimVars.allprocs.Add(new Procs
{
TreatmentBusinessID = Convert.ToInt32(proLocID.Text),
DiagCodeID = ClaimVars.DiagID,
CPTCodeID = ClaimVars.CPTID,
Charges = Convert.ToDouble(txtCharges.Text),
AmountPaid = Convert.ToDouble(txtPaid.Text),
DateServicedFrom = Convert.ToDateTime(dateTimePicker1.Text),
DateServicedToo = Convert.ToDateTime(dateTimePicker2.Text),
Notes = notesDiagServ.Text
});
// Change the DataSource.
listBox1.DataSource = null;
listBox1.DataSource = ClaimVars.allprocs;
}
}
They will see a new list item.
How do I display the values of this class rather than adding the name of the object?
After adding a proceedures, this is how my listbox looks:
Project_LB223.ClaimForms.Procs
Project_LB223.ClaimForms.Procs
Project_LB223.ClaimForms.Procs
Project_LB223.ClaimForms.Procs
This is how I would like it to look:
1 32 44 33.44 22.17 12/17/09 11:21:52 12/22/09 10:31:64 patient was feeling sick.
2 42 72 12.45 10.67 12/18/09 22:51:22 12/23/09 11:21:25 patient was showing signs of fatigue and shortness of breath.
1 68 57 83.64 55.47 12/19/09 23:25:45 12/24/09 15:38:42 the patient is feeling better.
5 12 22 37.44 23.45 12/22/09 16:81:11 12/25/09 19:35:22 the patient does not have any more symptoms.