/// <summary> /// Builds a ChargeList from a collection for data rows from a /// TuneList. /// </summary> /// <param name="tl">TuneList to build from</param> /// <returns>Newly created ChargeList</returns> public ChargeList BuildChargeList(TuneList tl) { ChargeList cl = new ChargeList(); DataGridViewRowCollection tuneRows = tl.GetAllTuneRows(); foreach (DataGridViewRow row in tuneRows) { string noteCell = row.Cells["colNotes"].Value.ToString(); if (noteCell != string.Empty) { cl.AddTune(row.Cells["colTuneType"].Value.ToString(), row.Cells["colAssetNumber"].Value.ToString() + ": " + noteCell); } else { cl.AddTune(row.Cells["colTuneType"].Value.ToString(), string.Empty); } } return cl; }