I am trying to modify some code written by another gentleman that generates flat files in various formats. The particular flat file in question is one that is positionally defined - Value X is at position 10, Value Y at 17, and value Z at 26, etc.
When the user clicks the "Create File" button, this extract gets called:
ReadOnlyCollection<IDataRow> dataRows = null;
try
{
dataRows = FlatFileExporter.MerrillLynch.GetMerrillLynchData(mPostSeq, mPaycheckDate, mPayrollStartDate, mPayrollEndDate);
}
catch (Exception ex)
{
Response.Write((ex.InnerException != null ? ex.InnerException.Message + "; " : "") + ex.Message);
}
At this point, I know I have this ReadOnlyCollection named dataRows. It was populated from a Stored Procedure "GetMerrillLynchData" in this routine:
public static ReadOnlyCollection<IDataRow> GetMerrillLynchData(string postSeq, DateTime paycheckDate, DateTime payrollStartDate, DateTime payrollEndDate)
{
string dateFormat = "MM/dd/yyyy";
string query = string.Format(
"exec GatherMerrillLynchPayrollData {0}, '{1}', '{2}', '{3}'",
"'" + postSeq + "'",
paycheckDate.ToString(dateFormat),
payrollStartDate.ToString(dateFormat),
payrollEndDate.ToString(dateFormat)
);
return FileGenerator.GetDataRows(query, MerrillLynchMeta.Columns, dict => new MerrillLynchDataRow(dict));
}
The ReadOnlyCollection will be fed to a FlatFileGenerator which will output the properly formatted file.
The Problem: Our Payroll Admin wants to be able to make edits to that file before it is FTP'd to Merrill Lynch. I am wondering if it is possible to open and edit dataRows (maybe in a GridView?) before it is sent to the FlatFileGenerator. Then after she is done editing I'd like to save her edits right back to dataRows and continue with the code as it is written.
Can this be done?