Purged the row grouping code from the modify record form as it is no longer needed as well a moving all the main control events into their own toggle functions to make event enabling/disabling more consistent.

This commit is contained in:
2017-12-10 23:53:34 -06:00
parent e37b8c840a
commit 13af4ff791
4 changed files with 561 additions and 499 deletions
+18 -4
View File
@@ -111,6 +111,7 @@
this.informationPanel = new System.Windows.Forms.Panel(); this.informationPanel = new System.Windows.Forms.Panel();
this.errorLabel = new System.Windows.Forms.Label(); this.errorLabel = new System.Windows.Forms.Label();
this.addRecordButton = new System.Windows.Forms.Button(); this.addRecordButton = new System.Windows.Forms.Button();
this.insertAdSepecialRowButton = new System.Windows.Forms.Button();
this.mainLayoutPanel.SuspendLayout(); this.mainLayoutPanel.SuspendLayout();
this.mainMenuStrip.SuspendLayout(); this.mainMenuStrip.SuspendLayout();
this.mainTabControl.SuspendLayout(); this.mainTabControl.SuspendLayout();
@@ -187,7 +188,7 @@
// exitFileMainMenu // exitFileMainMenu
// //
this.exitFileMainMenu.Name = "exitFileMainMenu"; this.exitFileMainMenu.Name = "exitFileMainMenu";
this.exitFileMainMenu.Size = new System.Drawing.Size(240, 34); this.exitFileMainMenu.Size = new System.Drawing.Size(137, 34);
this.exitFileMainMenu.Text = "E&xit"; this.exitFileMainMenu.Text = "E&xit";
// //
// editMainMenu // editMainMenu
@@ -201,7 +202,7 @@
// createNewRecordEditMainMenu // createNewRecordEditMainMenu
// //
this.createNewRecordEditMainMenu.Name = "createNewRecordEditMainMenu"; this.createNewRecordEditMainMenu.Name = "createNewRecordEditMainMenu";
this.createNewRecordEditMainMenu.Size = new System.Drawing.Size(283, 34); this.createNewRecordEditMainMenu.Size = new System.Drawing.Size(282, 34);
this.createNewRecordEditMainMenu.Text = "&Create New Record"; this.createNewRecordEditMainMenu.Text = "&Create New Record";
this.createNewRecordEditMainMenu.Click += new System.EventHandler(this.CreateNewRecordEditMainMenuOnClick); this.createNewRecordEditMainMenu.Click += new System.EventHandler(this.CreateNewRecordEditMainMenuOnClick);
// //
@@ -217,14 +218,14 @@
// showConsoleHelpMainMenu // showConsoleHelpMainMenu
// //
this.showConsoleHelpMainMenu.Name = "showConsoleHelpMainMenu"; this.showConsoleHelpMainMenu.Name = "showConsoleHelpMainMenu";
this.showConsoleHelpMainMenu.Size = new System.Drawing.Size(286, 34); this.showConsoleHelpMainMenu.Size = new System.Drawing.Size(285, 34);
this.showConsoleHelpMainMenu.Text = "Sh&ow/Hide Console"; this.showConsoleHelpMainMenu.Text = "Sh&ow/Hide Console";
this.showConsoleHelpMainMenu.Click += new System.EventHandler(this.DisplayLogConsole); this.showConsoleHelpMainMenu.Click += new System.EventHandler(this.DisplayLogConsole);
// //
// examineLogsHelpMainMenu // examineLogsHelpMainMenu
// //
this.examineLogsHelpMainMenu.Name = "examineLogsHelpMainMenu"; this.examineLogsHelpMainMenu.Name = "examineLogsHelpMainMenu";
this.examineLogsHelpMainMenu.Size = new System.Drawing.Size(286, 34); this.examineLogsHelpMainMenu.Size = new System.Drawing.Size(285, 34);
this.examineLogsHelpMainMenu.Text = "Examine &Logs"; this.examineLogsHelpMainMenu.Text = "Examine &Logs";
this.examineLogsHelpMainMenu.Click += new System.EventHandler(this.ViewLogFiles); this.examineLogsHelpMainMenu.Click += new System.EventHandler(this.ViewLogFiles);
// //
@@ -946,6 +947,7 @@
// //
// informationPanel // informationPanel
// //
this.informationPanel.Controls.Add(this.insertAdSepecialRowButton);
this.informationPanel.Controls.Add(this.errorLabel); this.informationPanel.Controls.Add(this.errorLabel);
this.informationPanel.Controls.Add(this.addRecordButton); this.informationPanel.Controls.Add(this.addRecordButton);
this.informationPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.informationPanel.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -974,6 +976,17 @@
this.addRecordButton.UseVisualStyleBackColor = true; this.addRecordButton.UseVisualStyleBackColor = true;
this.addRecordButton.Click += new System.EventHandler(this.SaveRecordOnAddRecordButtonClick); this.addRecordButton.Click += new System.EventHandler(this.SaveRecordOnAddRecordButtonClick);
// //
// insertAdSepecialRowButton
//
this.insertAdSepecialRowButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.insertAdSepecialRowButton.Location = new System.Drawing.Point(8, 133);
this.insertAdSepecialRowButton.Name = "insertAdSepecialRowButton";
this.insertAdSepecialRowButton.Size = new System.Drawing.Size(167, 41);
this.insertAdSepecialRowButton.TabIndex = 29;
this.insertAdSepecialRowButton.Text = "Insert Ad Row";
this.insertAdSepecialRowButton.UseVisualStyleBackColor = true;
this.insertAdSepecialRowButton.Visible = false;
//
// NewModifyRecord // NewModifyRecord
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
@@ -1104,5 +1117,6 @@
private System.Windows.Forms.ToolStripMenuItem helpMainMenu; private System.Windows.Forms.ToolStripMenuItem helpMainMenu;
private System.Windows.Forms.ToolStripMenuItem examineLogsHelpMainMenu; private System.Windows.Forms.ToolStripMenuItem examineLogsHelpMainMenu;
private System.Windows.Forms.ToolStripMenuItem showConsoleHelpMainMenu; private System.Windows.Forms.ToolStripMenuItem showConsoleHelpMainMenu;
private System.Windows.Forms.Button insertAdSepecialRowButton;
} }
} }
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -58,7 +58,7 @@ namespace DataTableParsingEngine
return RowAttribute.NewRow; return RowAttribute.NewRow;
} }
//Determine the range to use during the looping process. //Determine the range to use during the looping process.
var headerCellIndex = row.Cells.Count == Enum.GetNames(typeof(TableGroupParser.SalesTableColumns)).Length ? (int)TableGroupParser.SalesTableColumns.IsHeaderRow : (int)TableGroupParser.InventoryTableColumns.IsHeaderRow; var headerCellIndex = row.Cells.Count == Enum.GetNames(typeof(TableGroupParser.SalesTableColumns)).Length ? (int)TableGroupParser.SalesTableColumns.IsDirty : (int)TableGroupParser.InventoryTableColumns.IsDirty;
var rowContents = new List<string>(); var rowContents = new List<string>();
var rowAttribute = RowAttribute.MemberRow; var rowAttribute = RowAttribute.MemberRow;
//Get the contents of the row that's being examined and add then to a List<string> array. //Get the contents of the row that's being examined and add then to a List<string> array.
+10 -14
View File
@@ -15,17 +15,17 @@ namespace DataTableParsingEngine
/// <param name="table">The DataGridView to parse.</param> /// <param name="table">The DataGridView to parse.</param>
/// <param name="startingIndex">The starting index (the row that fired the RowLeave event)</param> /// <param name="startingIndex">The starting index (the row that fired the RowLeave event)</param>
/// <param name="fullScan">True to force a full scan of all rows beginning at the starting index.</param> /// <param name="fullScan">True to force a full scan of all rows beginning at the starting index.</param>
public static bool PaintRowGroups(DataGridView table, int startingIndex, bool fullScan = false) public static bool PaintRowGroupss(DataGridView table, int startingIndex, bool fullScan = false)
{ {
var parser = new RowParser(); var parser = new RowParser();
var isHeaderColumn = (int) SalesTableColumns.IsHeaderRow; var isHeaderColumn = 1;//(int) SalesTableColumns.IsHeaderRow;
var isMemberColumn = (int) SalesTableColumns.IsMemberRow; var isMemberColumn = 2;//(int) SalesTableColumns.IsMemberRow;
var isDirtyColumn = (int) SalesTableColumns.IsDirty; var isDirtyColumn = (int) SalesTableColumns.IsDirty;
var updatesOccured = false; var updatesOccured = false;
if (table.ColumnCount < Enum.GetNames(typeof(SalesTableColumns)).Length) if (table.ColumnCount < Enum.GetNames(typeof(SalesTableColumns)).Length)
{ {
isHeaderColumn = (int) InventoryTableColumns.IsHeaderRow; isHeaderColumn = 2;//(int) InventoryTableColumns.IsHeaderRow;
isMemberColumn = (int) InventoryTableColumns.IsMemberRow; isMemberColumn = 5;//(int) InventoryTableColumns.IsMemberRow;
isDirtyColumn = (int) InventoryTableColumns.IsDirty; isDirtyColumn = (int) InventoryTableColumns.IsDirty;
} }
//Spin through the dataGridView rows starting at the row that fired the event. //Spin through the dataGridView rows starting at the row that fired the event.
@@ -233,13 +233,13 @@ namespace DataTableParsingEngine
return updatesOccured; return updatesOccured;
} }
public static bool PaintIneventory(DataGridView inventoryDataGridView, DataGridView masterGridView, public static bool PaintIneventorys(DataGridView inventoryDataGridView, DataGridView masterGridView,
int startingIndex, bool fullScan = false) int startingIndex, bool fullScan = false)
{ {
var parser = new RowParser(); var parser = new RowParser();
var updatesOccured = false; var updatesOccured = false;
const int isHeaderColumn = (int)InventoryTableColumns.IsHeaderRow; const int isHeaderColumn = 2;
const int isMemberColumn = (int)InventoryTableColumns.IsMemberRow; const int isMemberColumn = 1;
const int isDirtyColumn = (int)InventoryTableColumns.IsDirty; const int isDirtyColumn = (int)InventoryTableColumns.IsDirty;
//Spin through the dataGridView rows starting at the row that fired the event. //Spin through the dataGridView rows starting at the row that fired the event.
for (var i = startingIndex; i < (inventoryDataGridView.RowCount - 1); i++) for (var i = startingIndex; i < (inventoryDataGridView.RowCount - 1); i++)
@@ -453,9 +453,7 @@ namespace DataTableParsingEngine
Cost = 5, Cost = 5,
ProfitReturn = 6, ProfitReturn = 6,
TotalProfitReturn = 7, TotalProfitReturn = 7,
IsHeaderRow = 8, IsDirty = 8
IsMemberRow = 9,
IsDirty = 10
} }
public enum InventoryTableColumns public enum InventoryTableColumns
@@ -466,9 +464,7 @@ namespace DataTableParsingEngine
Recieved = 3, Recieved = 3,
Total = 4, Total = 4,
EndingInventory = 5, EndingInventory = 5,
IsHeaderRow = 6, IsDirty = 6
IsMemberRow = 7,
IsDirty = 8
} }
public enum InvoiceTableColumns public enum InvoiceTableColumns