namespace Pread835
{
public class LineItem
{
public string ClaimNo { get; set; }
public string PatID { get; set; }
public string ProcCode { get; set; }
public string ChargeAmt { get; set; }
public string PaidAmt { get; set; }
public string Dos { get; set; }
public string COadj { get; set; }
public string PR1adj { get; set; }
public string PR2adj { get; set; }
public string PR3adj { get; set; }
public string TranNo { get; set; }
public LineItem Initialize()
{
this.ClaimNo = "";
this.ChargeAmt = "";
this.COadj = "";
this.Dos = "";
this.PatID = "";
this.ProcCode = "";
this.PaidAmt = "";
this.PR1adj = "";
this.PR2adj = "";
this.PR3adj = "";
this.TranNo = "";
return this;
}
}}
public List<LineItem> lineList = new List<LineItem>();
LineItem t = new LineItem();
t.Initialize();
// the beginning of a loop where I am reading through a file to get values
t.ClaimNo = c.ClaimNo;
t.ProcCode = theSeg[1].Substring(3);
t.ChargeAmt = theSeg[2];
t.PaidAmt = theSeg[3];
lineList.Add(t);
t.Initialize();
// end of the loop
The values of t do change in the loop
However only the values in the first t are written over and over to the list..
What am I doing wrong?
Thanks in advance for your help
Dave