From 739c4c179d758d57768f314cfb4ce79604395a39 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Mon, 23 Jan 2017 00:26:46 -0600 Subject: [PATCH] Fixed a bug in the row parsing engine related to ad special rows. Move all data from the old format to the new format. Updated the main form's UI. --- AdvertsingProfitControl/APCDatabase.accdb | Bin 851968 -> 864256 bytes .../AdvertisingProfitControlTableHelper.cs | 9 +- AdvertsingProfitControl/DatabaseReader.cs | 6 +- AdvertsingProfitControl/DatabaseWriter.cs | 36 +++-- .../DebugDatabaseConverter.cs | 90 ++++++++++--- AdvertsingProfitControl/FrmMain.Designer.cs | 126 +++++++++--------- AdvertsingProfitControl/FrmMain.cs | 81 +++++------ AdvertsingProfitControl/NewAddRecord.cs | 14 +- AdvertsingProfitControl/NewModifyRecord.cs | 14 +- ...AdvertsingProfitControl.vshost.application | 2 +- ...dvertsingProfitControl.vshost.exe.manifest | 8 +- 11 files changed, 228 insertions(+), 158 deletions(-) diff --git a/AdvertsingProfitControl/APCDatabase.accdb b/AdvertsingProfitControl/APCDatabase.accdb index 2ebb38dfcf4230db3727ea9a3bee71d4b4fa8a82..aea25ee3b766c3fd6c2a5e3d3c5702c0bf8858c5 100644 GIT binary patch delta 51032 zcmZo@Fll&TvVn<@xs*k9vmoDl#>onNJeveg^G`0wX6JNZkYEsCU|{$$U6Gqrb(4ak zFZ)*~1_p7#OC>oDkYBB+9srleM3xc>n(CXXO|r8B^My%Q0?$F2|%<$lAxiz|cQkbOMu} zWC{ZUa3PosebWORm`$h8HDHn5zHS234Y`RM_@?Evn@`JU=Vnxxs=%np%EG9`sX1|> z_+*&{^EWP3Wt{%tA`^T4R+jn(1_ovZhOK;1#z`=Pg@GYb1th}Gz_8U2#Nc3H*s2F* zoYVj@xEL5B1wjlx28Ku;C}XQKlyOoP#1LR$h-88?P71&nU^Rja43YIpAR$2phOMF? zh7be8R%R&Uq!5T9%)k)I0AujO7>XcZBM2>;sB-mCZ28ONdAQ5E-hOMk1 zhB^boRxS`jgM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UL)7A;_xMyY4EPh7zMUT$(hw(I1AY)Bzgg_7MIAyte% ztPs+N6+-&3LP#H025obKUO45~9OvZEC+ zsL~ISq_=%w7uYae-~hAabj<}EQjCn#117LoZm(Uy(F!WkyHJYsgB-9T{Q`#oRMQ0x zDQGQlfdgC%^rC3_2-gCt1#rl16X0Yr;MV5#M5H|jPEgw8dd4$xgR2w=1E}H$OYVH) zuwmv*P;mt2PS5t`)ZtcWfi*)IrZ4j4H05@gju3d{%c;wK;IsxDm6AI@|(I9AF;E-bMbLCfr-Hgy8}Y{W%qR+xS806(q*UFm1D-Ks*2RY4My{ z+aB<&#Z2193=9k^91IS;)3blESZyodWK!UjV*n*-P}_--L2u$hrcLo3S?fzWeyi53dL3T4RFfcM~*(@lq zlz;n{c&_LN+xZoEC-F~T=+7O$?E~v~#*G^y*tYve@N8rkWn$z9wfq=fGJx7g3=BIN z7#Ma<7fs;SW8AUbC4qaNKX)zHHmIpG(|I>=TW(yK$0f$Zu#16#fsKI)0+|?s7*ZKh zrZ1etEk0df1~=FC*SomIMVaTbZ=1MKe7ej9?hDf=?dNitxM9Qg2N$_p*;scmFzlAz zxNsW#vIpD^e4LEez?m6j5g)^Jfe$>gQ-!&TL5{3q-p<6rWzDkvm@%g@%X9-9&erYR zu{>XyP`t94eK}JDkHB`O0U^~mez<8En`$i>3f8LE7ikX&8;1b|v zWIV=R1hR;MfkACLZv&4vqr!B-2b|p-H`uW2GBa#tU|(); var oleDbCommand = new OleDbCommand { - CommandText = "SELECT EndOfWeekDate FROM WeekEnding" + CommandText = "SELECT WeekEnding.EndOfWeekDate FROM WeekEnding" }; var connection = new OleDbConnection(connectionString); oleDbCommand.Connection = connection; @@ -414,9 +414,9 @@ namespace AdvertsingProfitControl } } } - catch (OleDbException e) + finally { - + connection.Close(); } } } diff --git a/AdvertsingProfitControl/DatabaseWriter.cs b/AdvertsingProfitControl/DatabaseWriter.cs index 513c661..dd38de0 100644 --- a/AdvertsingProfitControl/DatabaseWriter.cs +++ b/AdvertsingProfitControl/DatabaseWriter.cs @@ -477,27 +477,35 @@ namespace AdvertsingProfitControl oleDbCommand.Parameters.AddWithValue("ID", int.Parse(table.Rows[i].Cells[(int)InvoiceTableColumns.Id].EditedFormattedValue.ToString())); oleDbCommand.ExecuteNonQuery(); oleDbCommand.Parameters.Clear(); + rowsAdded.Add(i); } //Row index is only used to keep track of what row failed to update. lastRowProcessed = i + 1; } oleDbTransaction.Commit(); - foreach (DataGridViewRow row in table.Rows) + //Spin through the collection and update the affected rows. + foreach (var rowIndex in rowsAdded) { - if(row.IsNewRow) continue; - if (!rowsAdded.Contains(row.Index)) continue; - var supplierId = RetrieveSupplierId(row.Cells[(int)InvoiceTableColumns.Supplier].EditedFormattedValue.ToString()); - var invoiceIdNumber = - RetrieveInvoiceId( - row.Cells[(int)InvoiceTableColumns.InvoiceDate].EditedFormattedValue - .ToString(), - long.Parse( - row.Cells[(int)InvoiceTableColumns.InvoiceNumber].EditedFormattedValue - .ToString()), supplierId, dateId); - row.Cells[(int)InvoiceTableColumns.Id].Value = invoiceIdNumber; - row.Cells[(int)InvoiceTableColumns.IsDirty].Value = false; - row.HeaderCell.Style.BackColor = ApplicationColors.EditingSaved; + //Only reset the IsDirty value to false since the updates when through. + table.Rows[rowIndex].Cells[(int)InvoiceTableColumns.IsDirty].Value = false; + table.Rows[rowIndex].HeaderCell.Style.BackColor = ApplicationColors.EditingSaved; } + //foreach (DataGridViewRow row in table.Rows) + //{ + // if(row.IsNewRow) continue; + // if (!rowsAdded.Contains(row.Index)) continue; + // var supplierId = RetrieveSupplierId(row.Cells[(int)InvoiceTableColumns.Supplier].EditedFormattedValue.ToString()); + // var invoiceIdNumber = + // RetrieveInvoiceId( + // row.Cells[(int)InvoiceTableColumns.InvoiceDate].EditedFormattedValue + // .ToString(), + // long.Parse( + // row.Cells[(int)InvoiceTableColumns.InvoiceNumber].EditedFormattedValue + // .ToString()), supplierId, dateId); + // row.Cells[(int)InvoiceTableColumns.Id].Value = invoiceIdNumber; + // row.Cells[(int)InvoiceTableColumns.IsDirty].Value = false; + // row.HeaderCell.Style.BackColor = ApplicationColors.EditingSaved; + //} table.RefreshEdit(); //Set the status. status.SetStatus(WritingOperationStatus.InsertionSuccessful); diff --git a/AdvertsingProfitControl/DebugDatabaseConverter.cs b/AdvertsingProfitControl/DebugDatabaseConverter.cs index 373d544..be10c15 100644 --- a/AdvertsingProfitControl/DebugDatabaseConverter.cs +++ b/AdvertsingProfitControl/DebugDatabaseConverter.cs @@ -64,6 +64,7 @@ namespace AdvertsingProfitControl } } } + connection.Close(); } foreach (var date in dates) @@ -99,15 +100,14 @@ namespace AdvertsingProfitControl var actualSales = ReturnActualSales(oldDateId); var invoices = ReturnInvoiceTable(oldDateId); var weeklySales = ReturnWeeklySalesFromDateId(oldDateId); - MassiveWriteFunction(date.ToString(), projectionsTable, inventoryTable, actualSales, invoices, weeklySales); + var comment = GetComments(oldDateId); + MassiveWriteFunction(date.ToString(), projectionsTable, inventoryTable, actualSales, invoices, weeklySales, comment); } } - - private void MassiveWriteFunction(string dateString, DataTable projections, DataTable inventory, DataTable actualSales, DataTable invoice, DataTable weeklySales) + private void MassiveWriteFunction(string dateString, DataTable projections, DataTable inventory, DataTable actualSales, DataTable invoice, DataTable weeklySales, string comments) { var dbT = new DatabaseTracker(); - var dbR = new DatabaseReader(); //Get a new ID number for the date supplied. var oleDbConnection = new OleDbConnection(dbT.DatabaseConnectionString); var oleDbCommand = new OleDbCommand @@ -149,7 +149,7 @@ namespace AdvertsingProfitControl //Get the group name of the ad special its in. adspecialId = GetAdSpecialId(int.Parse(projections.Rows[rowIndex][8].ToString())); oleDbCommand.CommandText = - "INSERT INTO Projections (Sold, SalePrice, TotalSales, Cost, ProfitReturn, TotalProfitReturn, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + "INSERT INTO Projections (Sold, SalePrice, TotalSales, Cost, ProfitReturn, TotalProfitReturn, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; //SELECT AdItem.AdItem, APC.ProjectionSold, APC.ProjectionSalePrice, APC.ProjectionTotalSales, APC.ProjectionCost, APC.ProjectionProfitReturn, APC.ProjectionTotalProfitReturn, APC.RowAttribute, APC.FK_GroupID FROM (AdItem INNER JOIN APC ON AdItem.ID = APC.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC oleDbCommand.Parameters.AddWithValue("Sold", projections.Rows[rowIndex][1]); oleDbCommand.Parameters.AddWithValue("SalesPrice", projections.Rows[rowIndex][2]); @@ -158,7 +158,8 @@ namespace AdvertsingProfitControl oleDbCommand.Parameters.AddWithValue("ProfitReturn", projections.Rows[rowIndex][5]); oleDbCommand.Parameters.AddWithValue("TotalProfitReturn", projections.Rows[rowIndex][6]); oleDbCommand.Parameters.AddWithValue("adItemID", adItemId); - oleDbCommand.Parameters.AddWithValue("RowAttribute", int.Parse(projections.Rows[rowIndex][7].ToString())); + oleDbCommand.Parameters.AddWithValue("RowAttribute", + int.Parse(projections.Rows[rowIndex][7].ToString())); oleDbCommand.Parameters.AddWithValue("adSpecialID", adspecialId); oleDbCommand.Parameters.AddWithValue("RowPosition", (rowIndex + 1)); oleDbCommand.Parameters.AddWithValue("dateID", dateId); @@ -173,10 +174,10 @@ namespace AdvertsingProfitControl oleDbCommand.CommandText = "INSERT INTO Inventory (BeginningInventory, Received, TotalInventory, EndingInventory, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; //"SELECT AdItem.AdItem, APC.BeginingInventory, APC.Received, APC.TotalInventory, APC.EndingInventory, APC.RowAttribute, APC.FK_GroupID FROM (AdItem INNER JOIN APC ON AdItem.ID = APC.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC" - oleDbCommand.Parameters.AddWithValue("BegnningInventory", inventory.Rows[i][1]); - oleDbCommand.Parameters.AddWithValue("Received", inventory.Rows[i][2]); - oleDbCommand.Parameters.AddWithValue("TotalInventory", inventory.Rows[i][3]); - oleDbCommand.Parameters.AddWithValue("EndingInventory", inventory.Rows[i][4]); + oleDbCommand.Parameters.AddWithValue("BeginningInventory", inventory.Rows[i][1].ToString()); + oleDbCommand.Parameters.AddWithValue("Received", inventory.Rows[i][2].ToString()); + oleDbCommand.Parameters.AddWithValue("TotalInventory", inventory.Rows[i][3].ToString()); + oleDbCommand.Parameters.AddWithValue("EndingInventory", inventory.Rows[i][4].ToString()); oleDbCommand.Parameters.AddWithValue("AdItemID", adItemId); oleDbCommand.Parameters.AddWithValue("RowAttribute", int.Parse(inventory.Rows[i][5].ToString())); oleDbCommand.Parameters.AddWithValue("FK_AdSpecialGroup", adspecialId); @@ -193,7 +194,7 @@ namespace AdvertsingProfitControl var adItemId = int.Parse(RetrieveAdItemId(actualSales.Rows[rowIndex][0].ToString())); adspecialId = GetAdSpecialId(int.Parse(actualSales.Rows[rowIndex][8].ToString())); oleDbCommand.CommandText = - "INSERT INTO ActualSales (Sold, SalePrice, TotalSales, Cost, ProfitReturn, TotalProfitReturn, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + "INSERT INTO ActualSales (Sold, SalePrice, TotalSales, Cost, ProfitReturn, TotalProfitReturn, FK_AdItemID, RowAttribute, FK_AdSpecialGroupName, RowPosition, FK_DateID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; //SELECT AdItem.AdItem, APC.ProjectionSold, APC.ProjectionSalePrice, APC.ProjectionTotalSales, APC.ProjectionCost, APC.ProjectionProfitReturn, APC.ProjectionTotalProfitReturn, APC.RowAttribute, APC.FK_GroupID FROM (AdItem INNER JOIN APC ON AdItem.ID = APC.FK_AdItemID) WHERE FK_DateID = ? ORDER BY RowPosition ASC oleDbCommand.Parameters.AddWithValue("Sold", actualSales.Rows[rowIndex][1]); oleDbCommand.Parameters.AddWithValue("SalesPrice", actualSales.Rows[rowIndex][2]); @@ -202,7 +203,8 @@ namespace AdvertsingProfitControl oleDbCommand.Parameters.AddWithValue("ProfitReturn", actualSales.Rows[rowIndex][5]); oleDbCommand.Parameters.AddWithValue("TotalProfitReturn", actualSales.Rows[rowIndex][6]); oleDbCommand.Parameters.AddWithValue("adItemID", adItemId); - oleDbCommand.Parameters.AddWithValue("RowAttribute", int.Parse(projections.Rows[rowIndex][7].ToString())); + oleDbCommand.Parameters.AddWithValue("RowAttribute", + int.Parse(projections.Rows[rowIndex][7].ToString())); oleDbCommand.Parameters.AddWithValue("adSpecialID", adspecialId); oleDbCommand.Parameters.AddWithValue("RowPosition", (rowIndex + 1)); oleDbCommand.Parameters.AddWithValue("dateID", dateId); @@ -215,11 +217,13 @@ namespace AdvertsingProfitControl var supplierId = GetSupplierId(invoice.Rows[i][1].ToString()); //SELECT Invoice.InvoiceDate, Supplier.SupplierName, Invoice.InvoiceNumber, Invoice.InvoiceNetAmountAtCost, Invoice.InvoiceNetAmount, Invoice.InvoiceNote FROM (Supplier INNER JOIN Invoice ON Supplier.ID = Invoice.FK_Supplier) WHERE FK_DateID = ? oleDbCommand.CommandText = - "INSERT INTO Invoice (InvoiceDate, InvoiceNumber, InvoiceNetAmountAtCost, InvoiceNetAmount, InvoiceNote, FK_Supplier, FK_DateID) VALUES(?,?,?,?,?,?,?)"; + "INSERT INTO Invoice (InvoiceDate, InvoiceNumber, InvoiceNetAmountAtCost, InvoiceNetAmount, InvoiceNote, FK_Supplier, FK_DateID) VALUES(?,?,?,?,?,?,?)"; oleDbCommand.Parameters.AddWithValue("InvoiceDate", invoice.Rows[i][0].ToString()); oleDbCommand.Parameters.AddWithValue("InvoiceNumber", invoice.Rows[i][2].ToString()); - oleDbCommand.Parameters.AddWithValue("InvoiceNetAmountAtCost", invoice.Rows[i][3].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][3].ToString())); - oleDbCommand.Parameters.AddWithValue("InvoiceNetAmount", invoice.Rows[i][4].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][4].ToString())); + oleDbCommand.Parameters.AddWithValue("InvoiceNetAmountAtCost", + invoice.Rows[i][3].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][3].ToString())); + oleDbCommand.Parameters.AddWithValue("InvoiceNetAmount", + invoice.Rows[i][4].ToString() == "" ? 0 : double.Parse(invoice.Rows[i][4].ToString())); oleDbCommand.Parameters.AddWithValue("InvoiceNote", invoice.Rows[i][5].ToString()); oleDbCommand.Parameters.AddWithValue("FK_Supplier", supplierId); oleDbCommand.Parameters.AddWithValue("FK_DateID", dateId); @@ -227,7 +231,8 @@ namespace AdvertsingProfitControl oleDbCommand.Parameters.Clear(); } //"SELECT WeeklySales.Sunday, WeeklySales.Monday, WeeklySales.Tuesday, WeeklySales.Wednesday, WeeklySales.Thursday, WeeklySales.Friday, WeeklySales.Saturday, WeeklySales.TotalSales FROM WeeklySales WHERE FK_DateID = ?" - oleDbCommand.CommandText = "INSERT INTO WeeklySales (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, TotalSales, FK_DateID) VALUES (?,?,?,?,?,?,?,?,?)"; + oleDbCommand.CommandText = + "INSERT INTO WeeklySales (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, TotalSales, FK_DateID) VALUES (?,?,?,?,?,?,?,?,?)"; oleDbCommand.Parameters.AddWithValue("Sunday", weeklySales.Rows[0][0]); oleDbCommand.Parameters.AddWithValue("Monday", weeklySales.Rows[0][1]); oleDbCommand.Parameters.AddWithValue("Tuesday", weeklySales.Rows[0][2]); @@ -239,13 +244,22 @@ namespace AdvertsingProfitControl oleDbCommand.Parameters.AddWithValue("DateID", dateId); oleDbCommand.ExecuteNonQuery(); - oleDbTransaction.Commit(); + oleDbCommand.Parameters.Clear(); + oleDbCommand.CommandText = "INSERT INTO Comment (Comment, FK_DateID) VALUES (?, ?)"; + oleDbCommand.Parameters.AddWithValue("Com", comments); + oleDbCommand.Parameters.AddWithValue("FK", dateId); + oleDbCommand.ExecuteNonQuery(); + oleDbTransaction.Commit(); } catch (OleDbException e) { MessageBox.Show(e.Message); oleDbTransaction?.Rollback(); } + finally + { + oleDbConnection.Close(); + } } public int GetSupplierId(string supplierName) @@ -273,7 +287,10 @@ namespace AdvertsingProfitControl { MessageBox.Show(e.Message); } - + finally + { + oleDbConnection.Close(); + } return supplierId; } @@ -318,15 +335,46 @@ namespace AdvertsingProfitControl id = int.Parse(reader[0].ToString()); } reader?.Close(); + spam.Close(); } catch (OleDbException e) { MessageBox.Show(e.Message); throw; } + finally + { + oleDbConnection.Close(); + } return id; } + private string GetComments(int dateId) + { + var comments = ""; + var oleDbCommand = new OleDbCommand + { + CommandText = "SELECT Comment.Comment FROM Comment WHERE Comment.FK_DateID = ?" + }; + oleDbCommand.Parameters.AddWithValue("DateID", dateId); + var connection = new OleDbConnection(_connectionString); + oleDbCommand.Connection = connection; + using (connection) + { + using (oleDbCommand) + { + connection.Open(); + var reader = oleDbCommand.ExecuteReader(); + while (reader != null && reader.Read()) + { + comments = reader[0].ToString(); + } + } + } + + return comments; + } + public string RetrieveAdItemId(string adItemName) { var dbT = new DatabaseTracker(); @@ -359,6 +407,7 @@ namespace AdvertsingProfitControl } } } + connection.Close(); } return dateId; @@ -385,6 +434,7 @@ namespace AdvertsingProfitControl dataAdapter.Fill(dataTable); } } + connection.Close(); } return dataTable; } @@ -410,6 +460,7 @@ namespace AdvertsingProfitControl dataAdapter.Fill(dataTable); } } + connection.Close(); } return dataTable; } @@ -435,6 +486,7 @@ namespace AdvertsingProfitControl dataAdapter.Fill(dataTable); } } + connection.Close(); } return dataTable; } @@ -459,6 +511,7 @@ namespace AdvertsingProfitControl adapter.Fill(dataTable); } } + connection.Close(); } return dataTable; @@ -484,6 +537,7 @@ namespace AdvertsingProfitControl dataAdapter.Fill(dataTable); } } + connection.Close(); } return dataTable; diff --git a/AdvertsingProfitControl/FrmMain.Designer.cs b/AdvertsingProfitControl/FrmMain.Designer.cs index d6c8416..3be04f2 100644 --- a/AdvertsingProfitControl/FrmMain.Designer.cs +++ b/AdvertsingProfitControl/FrmMain.Designer.cs @@ -43,6 +43,8 @@ this.helpMainMenu = new System.Windows.Forms.ToolStripMenuItem(); this.showHideConsoleHelpMainMenu = new System.Windows.Forms.ToolStripMenuItem(); this.dbVersionHelpMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.debugToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.mainTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.commentMainTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.profitAnalysisMainGroupBox = new System.Windows.Forms.GroupBox(); @@ -100,8 +102,6 @@ this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel = new System.Windows.Forms.Label(); this.perfectGrossProfitLabel = new System.Windows.Forms.Label(); this.grossProfitDollarGrossProfitLabel = new System.Windows.Forms.Label(); - this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.debugToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.mainMenu.SuspendLayout(); this.mainTableLayoutPanel.SuspendLayout(); this.commentMainTableLayoutPanel.SuspendLayout(); @@ -127,7 +127,7 @@ // // printPreviewButton // - this.printPreviewButton.Location = new System.Drawing.Point(313, 277); + this.printPreviewButton.Location = new System.Drawing.Point(171, 273); this.printPreviewButton.Name = "printPreviewButton"; this.printPreviewButton.Size = new System.Drawing.Size(138, 49); this.printPreviewButton.TabIndex = 4; @@ -248,11 +248,27 @@ this.dbVersionHelpMainMenu.Text = "Get &Database Version"; this.dbVersionHelpMainMenu.Click += new System.EventHandler(this.dbVersionHelpMainMenu_Click); // + // debugToolStripMenuItem + // + this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.debugToolStripMenuItem1}); + this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; + this.debugToolStripMenuItem.Size = new System.Drawing.Size(87, 34); + this.debugToolStripMenuItem.Text = "Debug"; + this.debugToolStripMenuItem.Visible = false; + // + // debugToolStripMenuItem1 + // + this.debugToolStripMenuItem1.Name = "debugToolStripMenuItem1"; + this.debugToolStripMenuItem1.Size = new System.Drawing.Size(240, 34); + this.debugToolStripMenuItem1.Text = "Debug"; + this.debugToolStripMenuItem1.Click += new System.EventHandler(this.debugToolStripMenuItem1_Click); + // // mainTableLayoutPanel // this.mainTableLayoutPanel.ColumnCount = 2; - this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); - this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); + this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); this.mainTableLayoutPanel.Controls.Add(this.commentMainTableLayoutPanel, 0, 2); this.mainTableLayoutPanel.Controls.Add(this.mainMenu, 0, 0); this.mainTableLayoutPanel.Controls.Add(this.mainViewTabControl, 0, 1); @@ -272,10 +288,10 @@ // commentMainTableLayoutPanel // this.commentMainTableLayoutPanel.ColumnCount = 4; - this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 355F)); - this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27.5F)); - this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27.5F)); - this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 45F)); + this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 365F)); + this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.commentMainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F)); this.commentMainTableLayoutPanel.Controls.Add(this.profitAnalysisMainGroupBox, 3, 0); this.commentMainTableLayoutPanel.Controls.Add(this.weeklySalesGroupBox, 1, 0); this.commentMainTableLayoutPanel.Controls.Add(this.taxableGroupBox, 2, 0); @@ -286,7 +302,7 @@ this.commentMainTableLayoutPanel.Name = "commentMainTableLayoutPanel"; this.commentMainTableLayoutPanel.RowCount = 1; this.commentMainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.commentMainTableLayoutPanel.Size = new System.Drawing.Size(1375, 329); + this.commentMainTableLayoutPanel.Size = new System.Drawing.Size(1467, 329); this.commentMainTableLayoutPanel.TabIndex = 5; // // profitAnalysisMainGroupBox @@ -300,9 +316,9 @@ this.profitAnalysisMainGroupBox.Controls.Add(this.remainingSalesLabel); this.profitAnalysisMainGroupBox.Controls.Add(this.totalProfitFromAdItemsLabel); this.profitAnalysisMainGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.profitAnalysisMainGroupBox.Location = new System.Drawing.Point(918, 3); + this.profitAnalysisMainGroupBox.Location = new System.Drawing.Point(1028, 3); this.profitAnalysisMainGroupBox.Name = "profitAnalysisMainGroupBox"; - this.profitAnalysisMainGroupBox.Size = new System.Drawing.Size(454, 323); + this.profitAnalysisMainGroupBox.Size = new System.Drawing.Size(436, 323); this.profitAnalysisMainGroupBox.TabIndex = 2; this.profitAnalysisMainGroupBox.TabStop = false; this.profitAnalysisMainGroupBox.Text = "Profit Analysis"; @@ -332,7 +348,7 @@ // departmentSalesLabel // this.departmentSalesLabel.AutoSize = true; - this.departmentSalesLabel.Location = new System.Drawing.Point(11, 61); + this.departmentSalesLabel.Location = new System.Drawing.Point(11, 64); this.departmentSalesLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.departmentSalesLabel.Name = "departmentSalesLabel"; this.departmentSalesLabel.Size = new System.Drawing.Size(179, 25); @@ -342,7 +358,7 @@ // totalProfitReturnLabel // this.totalProfitReturnLabel.AutoSize = true; - this.totalProfitReturnLabel.Location = new System.Drawing.Point(11, 221); + this.totalProfitReturnLabel.Location = new System.Drawing.Point(11, 279); this.totalProfitReturnLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.totalProfitReturnLabel.Name = "totalProfitReturnLabel"; this.totalProfitReturnLabel.Size = new System.Drawing.Size(178, 25); @@ -352,7 +368,7 @@ // salesProducedLabel // this.salesProducedLabel.AutoSize = true; - this.salesProducedLabel.Location = new System.Drawing.Point(11, 93); + this.salesProducedLabel.Location = new System.Drawing.Point(11, 97); this.salesProducedLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.salesProducedLabel.Name = "salesProducedLabel"; this.salesProducedLabel.Size = new System.Drawing.Size(300, 25); @@ -362,17 +378,17 @@ // totalProfitReturnFromRemaingLabel // this.totalProfitReturnFromRemaingLabel.AutoSize = true; - this.totalProfitReturnFromRemaingLabel.Location = new System.Drawing.Point(11, 189); + this.totalProfitReturnFromRemaingLabel.Location = new System.Drawing.Point(11, 221); this.totalProfitReturnFromRemaingLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.totalProfitReturnFromRemaingLabel.Name = "totalProfitReturnFromRemaingLabel"; - this.totalProfitReturnFromRemaingLabel.Size = new System.Drawing.Size(380, 25); + this.totalProfitReturnFromRemaingLabel.Size = new System.Drawing.Size(220, 50); this.totalProfitReturnFromRemaingLabel.TabIndex = 4; - this.totalProfitReturnFromRemaingLabel.Text = "Total Profit Return From Remaining Sales: "; + this.totalProfitReturnFromRemaingLabel.Text = "Total Profit Return \r\nFrom Remaining Sales: "; // // remainingSalesLabel // this.remainingSalesLabel.AutoSize = true; - this.remainingSalesLabel.Location = new System.Drawing.Point(11, 125); + this.remainingSalesLabel.Location = new System.Drawing.Point(11, 130); this.remainingSalesLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.remainingSalesLabel.Name = "remainingSalesLabel"; this.remainingSalesLabel.Size = new System.Drawing.Size(170, 25); @@ -382,12 +398,12 @@ // totalProfitFromAdItemsLabel // this.totalProfitFromAdItemsLabel.AutoSize = true; - this.totalProfitFromAdItemsLabel.Location = new System.Drawing.Point(11, 157); + this.totalProfitFromAdItemsLabel.Location = new System.Drawing.Point(11, 163); this.totalProfitFromAdItemsLabel.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.totalProfitFromAdItemsLabel.Name = "totalProfitFromAdItemsLabel"; - this.totalProfitFromAdItemsLabel.Size = new System.Drawing.Size(342, 25); + this.totalProfitFromAdItemsLabel.Size = new System.Drawing.Size(182, 50); this.totalProfitFromAdItemsLabel.TabIndex = 3; - this.totalProfitFromAdItemsLabel.Text = "Total Profit Return From Ad Items (B): "; + this.totalProfitFromAdItemsLabel.Text = "Total Profit Return \r\nFrom Ad Items (B): "; // // weeklySalesGroupBox // @@ -400,9 +416,9 @@ this.weeklySalesGroupBox.Controls.Add(this.wednesdayWeeklySalesLabel); this.weeklySalesGroupBox.Controls.Add(this.sundayWeeklySalesLabel); this.weeklySalesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.weeklySalesGroupBox.Location = new System.Drawing.Point(358, 3); + this.weeklySalesGroupBox.Location = new System.Drawing.Point(368, 3); this.weeklySalesGroupBox.Name = "weeklySalesGroupBox"; - this.weeklySalesGroupBox.Size = new System.Drawing.Size(274, 323); + this.weeklySalesGroupBox.Size = new System.Drawing.Size(324, 323); this.weeklySalesGroupBox.TabIndex = 3; this.weeklySalesGroupBox.TabStop = false; this.weeklySalesGroupBox.Text = "Weekly Sales"; @@ -490,9 +506,9 @@ this.taxableGroupBox.Controls.Add(this.wednesdayTaxableLabel); this.taxableGroupBox.Controls.Add(this.sundayTaxableLabel); this.taxableGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.taxableGroupBox.Location = new System.Drawing.Point(638, 3); + this.taxableGroupBox.Location = new System.Drawing.Point(698, 3); this.taxableGroupBox.Name = "taxableGroupBox"; - this.taxableGroupBox.Size = new System.Drawing.Size(274, 323); + this.taxableGroupBox.Size = new System.Drawing.Size(324, 323); this.taxableGroupBox.TabIndex = 4; this.taxableGroupBox.TabStop = false; this.taxableGroupBox.Text = "Taxable"; @@ -575,7 +591,7 @@ this.dateTimeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; this.dateTimeGroupBox.Location = new System.Drawing.Point(3, 3); this.dateTimeGroupBox.Name = "dateTimeGroupBox"; - this.dateTimeGroupBox.Size = new System.Drawing.Size(349, 323); + this.dateTimeGroupBox.Size = new System.Drawing.Size(359, 323); this.dateTimeGroupBox.TabIndex = 5; this.dateTimeGroupBox.TabStop = false; // @@ -598,7 +614,7 @@ this.mainViewTabControl.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.mainViewTabControl.Name = "mainViewTabControl"; this.mainViewTabControl.SelectedIndex = 0; - this.mainViewTabControl.Size = new System.Drawing.Size(1375, 499); + this.mainViewTabControl.Size = new System.Drawing.Size(1467, 499); this.mainViewTabControl.TabIndex = 3; // // projectionTab @@ -608,7 +624,7 @@ this.projectionTab.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.projectionTab.Name = "projectionTab"; this.projectionTab.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6); - this.projectionTab.Size = new System.Drawing.Size(1367, 462); + this.projectionTab.Size = new System.Drawing.Size(1459, 462); this.projectionTab.TabIndex = 0; this.projectionTab.Text = "Projections"; this.projectionTab.UseVisualStyleBackColor = true; @@ -630,7 +646,7 @@ this.projectionsDataGridView.RowHeadersVisible = false; this.projectionsDataGridView.ShowCellErrors = false; this.projectionsDataGridView.ShowRowErrors = false; - this.projectionsDataGridView.Size = new System.Drawing.Size(1357, 450); + this.projectionsDataGridView.Size = new System.Drawing.Size(1449, 450); this.projectionsDataGridView.TabIndex = 0; // // inventoryTabPage @@ -639,7 +655,7 @@ this.inventoryTabPage.Location = new System.Drawing.Point(4, 33); this.inventoryTabPage.Name = "inventoryTabPage"; this.inventoryTabPage.Padding = new System.Windows.Forms.Padding(3); - this.inventoryTabPage.Size = new System.Drawing.Size(1367, 462); + this.inventoryTabPage.Size = new System.Drawing.Size(1521, 462); this.inventoryTabPage.TabIndex = 4; this.inventoryTabPage.Text = "Inventory"; this.inventoryTabPage.UseVisualStyleBackColor = true; @@ -658,7 +674,7 @@ this.inventoryDataGridView.RowHeadersVisible = false; this.inventoryDataGridView.RowTemplate.Height = 28; this.inventoryDataGridView.ShowRowErrors = false; - this.inventoryDataGridView.Size = new System.Drawing.Size(1361, 456); + this.inventoryDataGridView.Size = new System.Drawing.Size(1515, 456); this.inventoryDataGridView.TabIndex = 0; // // actualSalesTab @@ -667,7 +683,7 @@ this.actualSalesTab.Location = new System.Drawing.Point(4, 33); this.actualSalesTab.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.actualSalesTab.Name = "actualSalesTab"; - this.actualSalesTab.Size = new System.Drawing.Size(1367, 462); + this.actualSalesTab.Size = new System.Drawing.Size(1521, 462); this.actualSalesTab.TabIndex = 2; this.actualSalesTab.Text = "Actual Sales"; this.actualSalesTab.UseVisualStyleBackColor = true; @@ -684,7 +700,7 @@ this.actualSalesMainLayoutPanel.RowCount = 1; this.actualSalesMainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.actualSalesMainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 462F)); - this.actualSalesMainLayoutPanel.Size = new System.Drawing.Size(1367, 462); + this.actualSalesMainLayoutPanel.Size = new System.Drawing.Size(1521, 462); this.actualSalesMainLayoutPanel.TabIndex = 0; // // actualSalesDataGridView @@ -704,7 +720,7 @@ this.actualSalesDataGridView.RowHeadersVisible = false; this.actualSalesDataGridView.ShowCellErrors = false; this.actualSalesDataGridView.ShowRowErrors = false; - this.actualSalesDataGridView.Size = new System.Drawing.Size(1357, 450); + this.actualSalesDataGridView.Size = new System.Drawing.Size(1511, 450); this.actualSalesDataGridView.TabIndex = 1; // // suppliersTabPage @@ -714,7 +730,7 @@ this.suppliersTabPage.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.suppliersTabPage.Name = "suppliersTabPage"; this.suppliersTabPage.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6); - this.suppliersTabPage.Size = new System.Drawing.Size(1367, 462); + this.suppliersTabPage.Size = new System.Drawing.Size(1521, 462); this.suppliersTabPage.TabIndex = 1; this.suppliersTabPage.Text = "Invoices"; this.suppliersTabPage.UseVisualStyleBackColor = true; @@ -734,7 +750,7 @@ this.invoicesDataGridView.Name = "invoicesDataGridView"; this.invoicesDataGridView.ReadOnly = true; this.invoicesDataGridView.RowHeadersVisible = false; - this.invoicesDataGridView.Size = new System.Drawing.Size(1357, 450); + this.invoicesDataGridView.Size = new System.Drawing.Size(1511, 450); this.invoicesDataGridView.TabIndex = 0; // // commentsAndAnalysisLayoutPanel @@ -745,12 +761,12 @@ this.commentsAndAnalysisLayoutPanel.Controls.Add(this.costAnalysisGroupBox, 0, 1); this.commentsAndAnalysisLayoutPanel.Controls.Add(this.commentMainGroupBox, 0, 0); this.commentsAndAnalysisLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.commentsAndAnalysisLayoutPanel.Location = new System.Drawing.Point(1388, 43); + this.commentsAndAnalysisLayoutPanel.Location = new System.Drawing.Point(1480, 43); this.commentsAndAnalysisLayoutPanel.Name = "commentsAndAnalysisLayoutPanel"; this.commentsAndAnalysisLayoutPanel.RowCount = 2; this.commentsAndAnalysisLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.commentsAndAnalysisLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.commentsAndAnalysisLayoutPanel.Size = new System.Drawing.Size(456, 505); + this.commentsAndAnalysisLayoutPanel.Size = new System.Drawing.Size(364, 505); this.commentsAndAnalysisLayoutPanel.TabIndex = 6; // // costAnalysisGroupBox @@ -763,7 +779,7 @@ this.costAnalysisGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; this.costAnalysisGroupBox.Location = new System.Drawing.Point(3, 255); this.costAnalysisGroupBox.Name = "costAnalysisGroupBox"; - this.costAnalysisGroupBox.Size = new System.Drawing.Size(450, 247); + this.costAnalysisGroupBox.Size = new System.Drawing.Size(358, 247); this.costAnalysisGroupBox.TabIndex = 4; this.costAnalysisGroupBox.TabStop = false; this.costAnalysisGroupBox.Text = "Cost Analysis"; @@ -822,7 +838,7 @@ this.commentMainGroupBox.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.commentMainGroupBox.Name = "commentMainGroupBox"; this.commentMainGroupBox.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6); - this.commentMainGroupBox.Size = new System.Drawing.Size(446, 240); + this.commentMainGroupBox.Size = new System.Drawing.Size(354, 240); this.commentMainGroupBox.TabIndex = 1; this.commentMainGroupBox.TabStop = false; this.commentMainGroupBox.Text = "Comments"; @@ -836,7 +852,7 @@ this.commentsTextBox.Name = "commentsTextBox"; this.commentsTextBox.ReadOnly = true; this.commentsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.commentsTextBox.Size = new System.Drawing.Size(436, 206); + this.commentsTextBox.Size = new System.Drawing.Size(344, 206); this.commentsTextBox.TabIndex = 0; // // grossProfitGroupBox @@ -849,9 +865,9 @@ this.grossProfitGroupBox.Controls.Add(this.perfectGrossProfitLabel); this.grossProfitGroupBox.Controls.Add(this.grossProfitDollarGrossProfitLabel); this.grossProfitGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.grossProfitGroupBox.Location = new System.Drawing.Point(1388, 554); + this.grossProfitGroupBox.Location = new System.Drawing.Point(1480, 554); this.grossProfitGroupBox.Name = "grossProfitGroupBox"; - this.grossProfitGroupBox.Size = new System.Drawing.Size(456, 335); + this.grossProfitGroupBox.Size = new System.Drawing.Size(364, 335); this.grossProfitGroupBox.TabIndex = 7; this.grossProfitGroupBox.TabStop = false; this.grossProfitGroupBox.Text = "Gross Profit"; @@ -859,13 +875,12 @@ // usePreRenderedFilesCheckbox // this.usePreRenderedFilesCheckbox.AutoSize = true; - this.usePreRenderedFilesCheckbox.Location = new System.Drawing.Point(40, 288); + this.usePreRenderedFilesCheckbox.Location = new System.Drawing.Point(16, 288); this.usePreRenderedFilesCheckbox.Name = "usePreRenderedFilesCheckbox"; this.usePreRenderedFilesCheckbox.Size = new System.Drawing.Size(239, 29); this.usePreRenderedFilesCheckbox.TabIndex = 5; this.usePreRenderedFilesCheckbox.Text = "Use Pre-rendered Files"; this.usePreRenderedFilesCheckbox.UseVisualStyleBackColor = true; - this.usePreRenderedFilesCheckbox.Visible = false; // // grossProfitLessCostOfSales // @@ -890,9 +905,9 @@ this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.AutoSize = true; this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Location = new System.Drawing.Point(6, 163); this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Name = "grossProfitEstimatedWeeklyDeptmartmentExpenseLabel"; - this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Size = new System.Drawing.Size(368, 25); + this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Size = new System.Drawing.Size(206, 50); this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.TabIndex = 4; - this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Text = "Estimated Weekly Department Expense: "; + this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Text = "Estimated Weekly \r\nDepartment Expense: "; // // perfectGrossProfitLabel // @@ -912,21 +927,6 @@ this.grossProfitDollarGrossProfitLabel.TabIndex = 2; this.grossProfitDollarGrossProfitLabel.Text = "Dollar Gross Profit: "; // - // debugToolStripMenuItem - // - this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.debugToolStripMenuItem1}); - this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; - this.debugToolStripMenuItem.Size = new System.Drawing.Size(87, 34); - this.debugToolStripMenuItem.Text = "Debug"; - // - // debugToolStripMenuItem1 - // - this.debugToolStripMenuItem1.Name = "debugToolStripMenuItem1"; - this.debugToolStripMenuItem1.Size = new System.Drawing.Size(240, 34); - this.debugToolStripMenuItem1.Text = "Debug"; - this.debugToolStripMenuItem1.Click += new System.EventHandler(this.debugToolStripMenuItem1_Click); - // // FrmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(168F, 168F); diff --git a/AdvertsingProfitControl/FrmMain.cs b/AdvertsingProfitControl/FrmMain.cs index 2fa1d80..bfdb7e5 100644 --- a/AdvertsingProfitControl/FrmMain.cs +++ b/AdvertsingProfitControl/FrmMain.cs @@ -16,7 +16,7 @@ namespace AdvertsingProfitControl private double _totalInvoicePurchases; //Total Purchases private double _departmentSales; //weekly sales total private DateTime _currentActiveDate; - readonly FrmLogConsole _console = FrmLogConsole.GetStaticInstance; + private readonly FrmLogConsole _console = FrmLogConsole.GetStaticInstance; private int _LazyPageCounter; public FrmMain() @@ -33,7 +33,6 @@ namespace AdvertsingProfitControl ConstructInvoicesDataGridView(); RowParsing.AdSpecialGroups.AddRange(databaseReader.ReturnGroupNameList(databaseTracker.DatabaseConnectionString)); var date = databaseReader.RetrieveMostRecentDate(databaseTracker.DatabaseConnectionString); - monthCalendar.SelectionStart = date; _currentActiveDate = date; LoadDate(date); monthCalendar.DateChanged += ValidateDateChanged; @@ -47,7 +46,7 @@ namespace AdvertsingProfitControl if (actualSalesDataGridView.Rows.Count == 0) { salesProducedLabel.Text = @"Sales Produced By Ad Items (A): No Data"; - totalProfitFromAdItemsLabel.Text = @"Total Profit Return From Ad Items (B): No Data"; + totalProfitFromAdItemsLabel.Text = @"Total Profit Return " + Environment.NewLine + @" From Ad Items (B): No Data"; if (Math.Abs(_departmentSales) < 1) { departmentSalesLabel.Text = @"Department Sales: No Data"; @@ -76,7 +75,7 @@ namespace AdvertsingProfitControl } if (Math.Abs(_totalProfitReturnFromAdItems) < 1) { - totalProfitFromAdItemsLabel.Text = @"Total Profit Return From Ad Items (B): No Data"; + totalProfitFromAdItemsLabel.Text = @"Total Profit Return " + Environment.NewLine + @"From Ad Items (B): No Data"; incompleteData = true; } if (Math.Abs(_departmentSales) < 1) @@ -94,11 +93,11 @@ namespace AdvertsingProfitControl var remainingSales = _departmentSales - _salesProducedByAdItems; remainingSalesLabel.Text = @"Remaining Sales: " + remainingSales.ToString("C"); //Again assume the total profit return is larger then zero (0). - totalProfitFromAdItemsLabel.Text = @"Total Profit Return From Ad Items (B): " + _totalProfitReturnFromAdItems.ToString("C"); + totalProfitFromAdItemsLabel.Text = @"Total Profit Return" + Environment.NewLine + @" From Ad Items (B): " + _totalProfitReturnFromAdItems.ToString("C"); //Shrink is being used as a place holder for Cross Profit % which is obtained by dividing the total profit return from the department weekly retail sales. var totalProfitReturnFromRemainingSales = shrink*remainingSales; // - totalProfitReturnFromRemaingLabel.Text = @"Total Profit Return From Remaining Sales: " + totalProfitReturnFromRemainingSales.ToString("C"); + totalProfitReturnFromRemaingLabel.Text = @"Total Profit Return" + Environment.NewLine + @" From Remaining Sales: " + totalProfitReturnFromRemainingSales.ToString("C"); var totalProfitReturn = _totalProfitReturnFromAdItems + totalProfitReturnFromRemainingSales; totalProfitReturnLabel.Text = @"Total Profit Return: " + totalProfitReturn.ToString("C"); } @@ -125,8 +124,15 @@ namespace AdvertsingProfitControl private void addRecordToolStripMenuItem_Click(object sender, EventArgs e) { + var databaseTracker = new DatabaseTracker(); + var databaseReader = new DatabaseReader(); var form = new NewAddRecord(); form.ShowDialog(); + //One the user has closed the add record form, check to see if there is a newer date + //available. If so, reload the form. + var date = databaseReader.RetrieveMostRecentDate(databaseTracker.DatabaseConnectionString); + if (date == _currentActiveDate) return; + LoadDate(date); } private void showHideConsoleHelpMainMenu_Click(object sender, EventArgs e) @@ -153,6 +159,8 @@ namespace AdvertsingProfitControl { var form = new NewModifyRecord(monthCalendar.SelectionStart); form.ShowDialog(); + //On return reload the date that was just modified by the modify record form. + LoadDate(monthCalendar.SelectionStart); } private void manageItemsToolsMainMenu_Click(object sender, EventArgs e) @@ -253,20 +261,6 @@ namespace AdvertsingProfitControl printDialog.Document = new PrintDocument(); } - private void newFormTestToolStripMenuItem_Click(object sender, EventArgs e) - { - var form = new NewAddRecord(); - form.ShowDialog(); - - } - - private void newModifyRecordToolStripMenuItem_Click(object sender, EventArgs e) - { - var date = monthCalendar.SelectionStart; - var form = new NewModifyRecord(date); - form.ShowDialog(); - } - public enum FormRoll { AddRecords = 0, @@ -339,7 +333,7 @@ namespace AdvertsingProfitControl string[] invoicesColumnNames = { "InvoiceDate", "Supplier", "InvoiceNumber", "InvoiceNetAmountAtCost", - "InvoiceNetAmount", "InvoiceNote" + "InvoiceNetAmountExtendedRetail", "InvoiceNote" }; foreach (var name in invoicesColumnNames) @@ -428,6 +422,8 @@ namespace AdvertsingProfitControl } CalculateProfitAnalysis(); CalculateGrossProfit(); + monthCalendar.BoldedDates = databaseReader.RetrieveDates(databaseTracker.DatabaseConnectionString).ToArray(); + monthCalendar.SelectionStart = date; dateTimeGroupBox.Text = @"Loaded " + date.ToString("d"); } @@ -440,7 +436,7 @@ namespace AdvertsingProfitControl for (var rowIndex = 0; rowIndex < projections.Rows.Count; rowIndex++) { var newRow = new DataGridViewRow(); - for (var cellIndex = 0; cellIndex < projections.Rows[rowIndex].ItemArray.Length; cellIndex++) + for (var cellIndex = 1; cellIndex < projections.Rows[rowIndex].ItemArray.Length; cellIndex++) { //ID and Ad Item. if (cellIndex == 1) @@ -671,7 +667,7 @@ namespace AdvertsingProfitControl for (var rowIndex = 0; rowIndex < actualSales.Rows.Count; rowIndex++) { var newRow = new DataGridViewRow(); - for (var cellIndex = 0; cellIndex < actualSales.Rows[rowIndex].ItemArray.Length; cellIndex++) + for (var cellIndex = 1; cellIndex < actualSales.Rows[rowIndex].ItemArray.Length; cellIndex++) { //ID and Ad Item. if (cellIndex == 1) @@ -849,15 +845,15 @@ namespace AdvertsingProfitControl var netAmountAtCost = double.Parse(invoices.Rows[rowIndex].ItemArray[cellIndex].ToString()); if (netAmountAtCost.ToString("N2") != "0.00") { - _totalInvoicePurchases += netAmountAtCost; - cell.Value = netAmountAtCost; + cell.Value = netAmountAtCost.ToString("N2"); } row.Cells.Add(cell); break; case 5: var netAmoundExtendedRetail = double.Parse(invoices.Rows[rowIndex].ItemArray[cellIndex].ToString()); if (netAmoundExtendedRetail.ToString("N2") != "0.00") - { + { + _totalInvoicePurchases += netAmoundExtendedRetail; cell.Value = netAmoundExtendedRetail.ToString("N2"); } row.Cells.Add(cell); @@ -897,7 +893,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - sundayWeeklySalesLabel.Text = @"Sunday: $" + dollarAmount; + sundayWeeklySalesLabel.Text = @"Sunday: $" + dollarAmount.ToString("N2"); } else { @@ -909,7 +905,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - mondayWeeklySalesLabel.Text = @"Monday: $" + dollarAmount; + mondayWeeklySalesLabel.Text = @"Monday: $" + dollarAmount.ToString("N2"); } else { @@ -921,7 +917,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - tuesadayWeeklySalesLabel.Text = @"Tuesday: $" + dollarAmount; + tuesadayWeeklySalesLabel.Text = @"Tuesday: $" + dollarAmount.ToString("N2"); } else { @@ -933,7 +929,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - wednesdayWeeklySalesLabel.Text = @"Wednesday: $" + dollarAmount; + wednesdayWeeklySalesLabel.Text = @"Wednesday: $" + dollarAmount.ToString("N2"); } else { @@ -945,7 +941,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - thursdayWeeklySalesLabel.Text = @"Thursday: $" + dollarAmount; + thursdayWeeklySalesLabel.Text = @"Thursday: $" + dollarAmount.ToString("N2"); } else { @@ -957,7 +953,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - fridayWeeklySalesLabel.Text = @"Friday: $" + dollarAmount; + fridayWeeklySalesLabel.Text = @"Friday: $" + dollarAmount.ToString("N2"); } else { @@ -969,7 +965,7 @@ namespace AdvertsingProfitControl if (dollarAmount.ToString("N2") != "0.00") { _departmentSales += dollarAmount; - saturdayWeeklySalesLabel.Text = @"Saturday: $" + dollarAmount; + saturdayWeeklySalesLabel.Text = @"Saturday: $" + dollarAmount.ToString("N2"); } else { @@ -980,7 +976,7 @@ namespace AdvertsingProfitControl dollarAmount = double.Parse(weeklySales.Rows[0].ItemArray[cellIndex].ToString()); if (dollarAmount.ToString("N2") != "0.00") { - totalWeeklySalesLabel.Text = @"Total Sales: $" + dollarAmount; + totalWeeklySalesLabel.Text = @"Total Sales: $" + dollarAmount.ToString("N2"); } else { @@ -1165,7 +1161,8 @@ namespace AdvertsingProfitControl switch (holiday) { case Holidays.Thanksgiving: - case Holidays.Christmas: + case Holidays.Christmas: + case Holidays.NewYearsDay: holidayText = @"Closed for " + TextFormat.AddSpacesToSentence(holiday.ToString(), false); break; } @@ -1215,20 +1212,28 @@ namespace AdvertsingProfitControl departmentSalesLabel.Text = @"Department Sales: "; salesProducedLabel.Text = @"Sales Produced By Ad Items (A):"; remainingSalesLabel.Text = @"Remaining Sales:"; - totalProfitFromAdItemsLabel.Text = @"Total Profit Return From Ad Items (B): "; - totalProfitReturnFromRemaingLabel.Text = @"Total Profit Return From Remaining Sales: "; + totalProfitFromAdItemsLabel.Text = @"Total Profit Return" + Environment.NewLine + @" From Ad Items (B): "; + totalProfitReturnFromRemaingLabel.Text = @"Total Profit Return" + Environment.NewLine + @" From Remaining Sales: "; totalProfitReturnLabel.Text = @"Total Profit Return: "; grossProfitTotalSales.Text = @"Total Sales:"; grossProfitLessCostOfSales.Text = @"Less Cost of Sales: "; grossProfitDollarGrossProfitLabel.Text = @"Dollar Gross Profit: "; perfectGrossProfitLabel.Text = @"Percent Gross Profit: "; - grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Text = @"Estimated Weekly Department Expense: "; + grossProfitEstimatedWeeklyDeptmartmentExpenseLabel.Text = @"Estimated Weekly" + Environment.NewLine + @" Department Expense: "; } private void debugToolStripMenuItem1_Click(object sender, EventArgs e) { var form = new DebugDatabaseConverter(); form.ShowDialog(); + RefreshDateListing(); + } + + private void RefreshDateListing() + { + var databaseTracker = new DatabaseTracker(); + var databaseReader = new DatabaseReader(); + monthCalendar.BoldedDates = databaseReader.RetrieveDates(databaseTracker.DatabaseConnectionString).ToArray(); } } } diff --git a/AdvertsingProfitControl/NewAddRecord.cs b/AdvertsingProfitControl/NewAddRecord.cs index 98880cd..0ab6e34 100644 --- a/AdvertsingProfitControl/NewAddRecord.cs +++ b/AdvertsingProfitControl/NewAddRecord.cs @@ -32,6 +32,7 @@ namespace AdvertsingProfitControl //Flag showing whether or not the AdSpecialRow has been made in this session. private int _adSpecialIndex = -1; private readonly AdvertisingProfitControlTableHelper _tableHelperFunctions = new AdvertisingProfitControlTableHelper(); + private TabPage _debugTabPage; public NewAddRecord() { @@ -145,6 +146,9 @@ namespace AdvertsingProfitControl salaryDollarsTextBox.Validating += ValidateCostAnalysisValues; suppliesTextBox.Enter += StoreBeginningTextBoxValue; suppliesTextBox.Validating += ValidateCostAnalysisValues; + // + _debugTabPage = mainTabControl.TabPages[4]; + mainTabControl.TabPages.Remove(mainTabControl.TabPages[4]); } #region Invoice Table Events @@ -1741,7 +1745,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1777,7 +1781,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1813,7 +1817,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1845,7 +1849,7 @@ namespace AdvertsingProfitControl /// private void ConstructInvoicesDataGridView() { - string[] invoicesColumnNames = { "ID", "InvoiceDate", "Supplier", "InvoiceNumber", "InvoiceNetAmountAtCost", "InvoiceNetAmount", "InvoiceNote", "IsDirty"}; + string[] invoicesColumnNames = { "ID", "InvoiceDate", "Supplier", "InvoiceNumber", "InvoiceNetAmountAtCost", "InvoiceNetAmountExtendedRetail", "InvoiceNote", "IsDirty"}; foreach (var name in invoicesColumnNames) { @@ -1857,7 +1861,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { diff --git a/AdvertsingProfitControl/NewModifyRecord.cs b/AdvertsingProfitControl/NewModifyRecord.cs index 10150c6..cf05366 100644 --- a/AdvertsingProfitControl/NewModifyRecord.cs +++ b/AdvertsingProfitControl/NewModifyRecord.cs @@ -37,6 +37,7 @@ namespace AdvertsingProfitControl private DateTime _currentActiveDate; // private bool _isFormDirty; + private TabPage _debugTabPage; public NewModifyRecord(DateTime date) { @@ -155,6 +156,9 @@ namespace AdvertsingProfitControl salaryDollarsTextBox.Validating += ValidateCostAnalysisValues; suppliesTextBox.Enter += StoreBeginningTextBoxValue; suppliesTextBox.Validating += ValidateCostAnalysisValues; + // + _debugTabPage = mainTabControl.TabPages[4]; + mainTabControl.TabPages.Remove(mainTabControl.TabPages[4]); LoadDate(date); } @@ -1772,7 +1776,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1808,7 +1812,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1844,7 +1848,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { @@ -1876,7 +1880,7 @@ namespace AdvertsingProfitControl /// private void ConstructInvoicesDataGridView() { - string[] invoicesColumnNames = { "ID", "InvoiceDate", "Supplier", "InvoiceNumber", "InvoiceNetAmountAtCost", "InvoiceNetAmount", "InvoiceNote", "IsDirty" }; + string[] invoicesColumnNames = { "ID", "InvoiceDate", "Supplier", "InvoiceNumber", "InvoiceNetAmountAtCost", "InvoiceNetAmountExtendedRetail", "InvoiceNote", "IsDirty" }; foreach (var name in invoicesColumnNames) { @@ -1888,7 +1892,7 @@ namespace AdvertsingProfitControl HeaderText = TextFormat.AddSpacesToSentence(name, false), ValueType = typeof(string), SortMode = DataGridViewColumnSortMode.NotSortable, - MaxInputLength = 20 + MaxInputLength = 32 }; if (name.Contains("ID")) { diff --git a/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.application b/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.application index f3048b8..ddb59b2 100644 --- a/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.application +++ b/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.application @@ -14,7 +14,7 @@ - ZmIrPQhvIF7GlBAJN0yBg3h1MuQtzkOJb1/UsrzEMy4= + nyOAXUjfnUbIVrYC0oB0cu8gLrSavJvwTjvTea8xOas= diff --git a/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.exe.manifest b/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.exe.manifest index b96c020..2f2fc57 100644 --- a/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.exe.manifest +++ b/AdvertsingProfitControl/bin/Debug/AdvertsingProfitControl.vshost.exe.manifest @@ -43,14 +43,14 @@ - + - SWhDdqr4Cdz7+qIONWqHGBLDH1kQ6iFOt1ruAj6rHJo= + ls/iyC2eDGY0BQ9Li7lpS1H7GbQd5K5JGHSlWNDaCgA= @@ -87,13 +87,13 @@ e48EkTyChGHXYJETENSLw7RKQ1LZ5ZDUghEtiv5DmqY= - + - nhqBAxGBZPH2N33Fm5tbmCgDtejNQUBm/H3EHe0p9bg= + eoYVACg6mHeh3mJvCxuTkhCu87etUvZtA+DNmRHH5Vo=