private void ProcessInputFile(String FileName) { DataTable dt = ListToDT.CSVtoDatatable(FileName); DgImportInbound.DataSource = dt; dtImportFile = dt.Copy(); dt.Dispose(); }
//To process input file private void ProcessInputFile(String FileName) { DataTable dt = ListToDT.CSVtoDatatable(FileName); dtImport = dt.Copy(); //dt = CompareData(dt.Copy()); //HideUneccessaryColumns(dt); }
//To process input file private void ProcessInputFile(String FileName) { DataTable dt = ListToDT.CSVtoDatatable(FileName); dtImport = dt.Copy(); DataSet ds = CompareData(dt.Copy()); if (ds.Tables.Contains("Duplicate") && ds.Tables["Duplicate"].Rows.Count > 0) { DuplicateData(ds.Tables["Duplicate"]); String message = @"Duplicate Records Found"; String caption = "Import Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { String message = @"No Duplicate Rows Found"; String caption = "Import Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } if (ds.Tables.Contains("Result") && ds.Tables["Result"].Rows.Count > 0) { HideUneccessaryColumns(ds.Tables["Result"]); var rows = ds.Tables["Result"].Rows.OfType <DataRow>(); var columnTotal = rows.Sum(r => Convert.ToInt32((r["Shipped"].ToString() == "") ? 0 : int.Parse(r["Shipped"].ToString()))); if (columnTotal == 0) { String message = @"No New Records Found"; String caption = "Import Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } else { String message = @"New Records Found"; String caption = "Import Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } } else { String message = @"No Records Found"; String caption = "Import Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show(message, caption, buttons); } }