Updated the APC table builder so zeros won't show in some columns. Changed the ad special index setting to the cell validation event, and stabilized the user changing an ad item to an ad special keyword. Fixed a bug where saying no to deleting a row wouldn't work.

This commit is contained in:
2017-02-12 20:49:13 -06:00
parent 5bd80f0dce
commit 41ac2cfa62
17 changed files with 129 additions and 27102 deletions
Binary file not shown.
@@ -16,6 +16,11 @@ namespace AdvertsingProfitControl
/// <param name="dataGridView">The DataGridView to parse.</param>
public void PaintRowGroupsFromIndex(int startingIndex, DataGridView dataGridView)
{
//Underflow protection for the lazy.
if (startingIndex < 0)
{
return;
}
var parser = new RowParsing();
int isHeaderColumn;
int isMemberColumn;
@@ -140,12 +140,6 @@
<Compile Include="FrmAdSpecialRegister.Designer.cs">
<DependentUpon>FrmAdSpecialRegister.cs</DependentUpon>
</Compile>
<Compile Include="FrmDeleteRecord.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmDeleteRecord.Designer.cs">
<DependentUpon>FrmDeleteRecord.cs</DependentUpon>
</Compile>
<Compile Include="FrmMain.cs">
<SubType>Form</SubType>
</Compile>
@@ -158,12 +152,6 @@
<Compile Include="FrmManageAdItems.Designer.cs">
<DependentUpon>FrmManageAdItems.cs</DependentUpon>
</Compile>
<Compile Include="FrmModifyRecord.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmModifyRecord.Designer.cs">
<DependentUpon>FrmModifyRecord.cs</DependentUpon>
</Compile>
<Compile Include="FrontPageGenerator.cs" />
<Compile Include="GlobalClasses.cs" />
<Compile Include="FrmLogConsole.cs">
@@ -172,12 +160,6 @@
<Compile Include="FrmLogConsole.Designer.cs">
<DependentUpon>FrmLogConsole.cs</DependentUpon>
</Compile>
<Compile Include="NewAddRecord.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewAddRecord.Designer.cs">
<DependentUpon>NewAddRecord.cs</DependentUpon>
</Compile>
<Compile Include="RowParsing.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -190,9 +172,6 @@
<EmbeddedResource Include="FrmAdSpecialRegister.resx">
<DependentUpon>FrmAdSpecialRegister.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmDeleteRecord.resx">
<DependentUpon>FrmDeleteRecord.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
@@ -202,12 +181,6 @@
<EmbeddedResource Include="FrmManageAdItems.resx">
<DependentUpon>FrmManageAdItems.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmModifyRecord.resx">
<DependentUpon>FrmModifyRecord.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewAddRecord.resx">
<DependentUpon>NewAddRecord.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewModifyRecord.resx">
<DependentUpon>NewModifyRecord.cs</DependentUpon>
</EmbeddedResource>
-505
View File
@@ -1,505 +0,0 @@
namespace AdvertsingProfitControl
{
partial class FrmDeleteRecord
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDeleteRecord));
this.mainTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.fileMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.exitFileMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.projectionsTabPage = new System.Windows.Forms.TabPage();
this.projectionsDataGridView = new System.Windows.Forms.DataGridView();
this.inventoryTabPage = new System.Windows.Forms.TabPage();
this.inventoryDataGridView = new System.Windows.Forms.DataGridView();
this.actualTabPage = new System.Windows.Forms.TabPage();
this.actualSalesDataGridView = new System.Windows.Forms.DataGridView();
this.suppliersTabPage = new System.Windows.Forms.TabPage();
this.suppliersDataGridView = new System.Windows.Forms.DataGridView();
this.weeklySalesTabPage = new System.Windows.Forms.TabPage();
this.weeklySalesDataGridView = new System.Windows.Forms.DataGridView();
this.secondaryLayOutPanel = new System.Windows.Forms.TableLayoutPanel();
this.commmentsGroupBox = new System.Windows.Forms.GroupBox();
this.commentsTextBox = new System.Windows.Forms.TextBox();
this.datePickerGroupBox = new System.Windows.Forms.GroupBox();
this.informationLabel = new System.Windows.Forms.Label();
this.dateSelectorFormatLable = new System.Windows.Forms.Label();
this.yearComboBox = new System.Windows.Forms.ComboBox();
this.monthComboBox = new System.Windows.Forms.ComboBox();
this.dayComboBox = new System.Windows.Forms.ComboBox();
this.clearSelectedYearGroupBox = new System.Windows.Forms.GroupBox();
this.yearClearingWarningLabel = new System.Windows.Forms.Label();
this.clearSelectedYearInfoLabel = new System.Windows.Forms.Label();
this.DELETE = new System.Windows.Forms.Button();
this.mainTableLayoutPanel.SuspendLayout();
this.mainMenu.SuspendLayout();
this.mainTabControl.SuspendLayout();
this.projectionsTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.projectionsDataGridView)).BeginInit();
this.inventoryTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.inventoryDataGridView)).BeginInit();
this.actualTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.actualSalesDataGridView)).BeginInit();
this.suppliersTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.suppliersDataGridView)).BeginInit();
this.weeklySalesTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.weeklySalesDataGridView)).BeginInit();
this.secondaryLayOutPanel.SuspendLayout();
this.commmentsGroupBox.SuspendLayout();
this.datePickerGroupBox.SuspendLayout();
this.clearSelectedYearGroupBox.SuspendLayout();
this.SuspendLayout();
//
// mainTableLayoutPanel
//
this.mainTableLayoutPanel.ColumnCount = 1;
this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.mainTableLayoutPanel.Controls.Add(this.mainMenu, 0, 0);
this.mainTableLayoutPanel.Controls.Add(this.mainTabControl, 0, 1);
this.mainTableLayoutPanel.Controls.Add(this.secondaryLayOutPanel, 0, 2);
this.mainTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.mainTableLayoutPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.mainTableLayoutPanel.Name = "mainTableLayoutPanel";
this.mainTableLayoutPanel.RowCount = 3;
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F));
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.mainTableLayoutPanel.Size = new System.Drawing.Size(889, 564);
this.mainTableLayoutPanel.TabIndex = 0;
//
// mainMenu
//
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileMainMenu});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
this.mainMenu.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1);
this.mainMenu.Size = new System.Drawing.Size(889, 23);
this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "menuStrip1";
//
// fileMainMenu
//
this.fileMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitFileMainMenu});
this.fileMainMenu.Name = "fileMainMenu";
this.fileMainMenu.Size = new System.Drawing.Size(35, 21);
this.fileMainMenu.Text = "&File";
//
// exitFileMainMenu
//
this.exitFileMainMenu.Name = "exitFileMainMenu";
this.exitFileMainMenu.Size = new System.Drawing.Size(92, 22);
this.exitFileMainMenu.Text = "E&xit";
//
// mainTabControl
//
this.mainTabControl.Controls.Add(this.projectionsTabPage);
this.mainTabControl.Controls.Add(this.inventoryTabPage);
this.mainTabControl.Controls.Add(this.actualTabPage);
this.mainTabControl.Controls.Add(this.suppliersTabPage);
this.mainTabControl.Controls.Add(this.weeklySalesTabPage);
this.mainTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainTabControl.Location = new System.Drawing.Point(2, 25);
this.mainTabControl.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.mainTabControl.Name = "mainTabControl";
this.mainTabControl.SelectedIndex = 0;
this.mainTabControl.Size = new System.Drawing.Size(885, 374);
this.mainTabControl.TabIndex = 1;
//
// projectionsTabPage
//
this.projectionsTabPage.Controls.Add(this.projectionsDataGridView);
this.projectionsTabPage.Location = new System.Drawing.Point(4, 22);
this.projectionsTabPage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.projectionsTabPage.Name = "projectionsTabPage";
this.projectionsTabPage.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.projectionsTabPage.Size = new System.Drawing.Size(877, 348);
this.projectionsTabPage.TabIndex = 0;
this.projectionsTabPage.Text = "Projections";
this.projectionsTabPage.UseVisualStyleBackColor = true;
//
// projectionsDataGridView
//
this.projectionsDataGridView.AllowUserToAddRows = false;
this.projectionsDataGridView.AllowUserToResizeRows = false;
this.projectionsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.projectionsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.projectionsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.projectionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.projectionsDataGridView.Location = new System.Drawing.Point(2, 2);
this.projectionsDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.projectionsDataGridView.MultiSelect = false;
this.projectionsDataGridView.Name = "projectionsDataGridView";
this.projectionsDataGridView.ReadOnly = true;
this.projectionsDataGridView.RowTemplate.Height = 28;
this.projectionsDataGridView.ShowEditingIcon = false;
this.projectionsDataGridView.Size = new System.Drawing.Size(873, 344);
this.projectionsDataGridView.TabIndex = 0;
//
// inventoryTabPage
//
this.inventoryTabPage.Controls.Add(this.inventoryDataGridView);
this.inventoryTabPage.Location = new System.Drawing.Point(4, 22);
this.inventoryTabPage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.inventoryTabPage.Name = "inventoryTabPage";
this.inventoryTabPage.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.inventoryTabPage.Size = new System.Drawing.Size(866, 335);
this.inventoryTabPage.TabIndex = 1;
this.inventoryTabPage.Text = "Inventory";
this.inventoryTabPage.UseVisualStyleBackColor = true;
//
// inventoryDataGridView
//
this.inventoryDataGridView.AllowUserToAddRows = false;
this.inventoryDataGridView.AllowUserToResizeRows = false;
this.inventoryDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.inventoryDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.inventoryDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.inventoryDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.inventoryDataGridView.Location = new System.Drawing.Point(2, 2);
this.inventoryDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.inventoryDataGridView.Name = "inventoryDataGridView";
this.inventoryDataGridView.ReadOnly = true;
this.inventoryDataGridView.RowTemplate.Height = 28;
this.inventoryDataGridView.ShowEditingIcon = false;
this.inventoryDataGridView.Size = new System.Drawing.Size(862, 331);
this.inventoryDataGridView.TabIndex = 0;
//
// actualTabPage
//
this.actualTabPage.Controls.Add(this.actualSalesDataGridView);
this.actualTabPage.Location = new System.Drawing.Point(4, 22);
this.actualTabPage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.actualTabPage.Name = "actualTabPage";
this.actualTabPage.Size = new System.Drawing.Size(866, 335);
this.actualTabPage.TabIndex = 2;
this.actualTabPage.Text = "Actual Sales";
this.actualTabPage.UseVisualStyleBackColor = true;
//
// actualSalesDataGridView
//
this.actualSalesDataGridView.AllowUserToAddRows = false;
this.actualSalesDataGridView.AllowUserToResizeRows = false;
this.actualSalesDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.actualSalesDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.actualSalesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.actualSalesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.actualSalesDataGridView.Location = new System.Drawing.Point(0, 0);
this.actualSalesDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.actualSalesDataGridView.Name = "actualSalesDataGridView";
this.actualSalesDataGridView.ReadOnly = true;
this.actualSalesDataGridView.RowTemplate.Height = 28;
this.actualSalesDataGridView.ShowEditingIcon = false;
this.actualSalesDataGridView.Size = new System.Drawing.Size(866, 335);
this.actualSalesDataGridView.TabIndex = 0;
//
// suppliersTabPage
//
this.suppliersTabPage.Controls.Add(this.suppliersDataGridView);
this.suppliersTabPage.Location = new System.Drawing.Point(4, 22);
this.suppliersTabPage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.suppliersTabPage.Name = "suppliersTabPage";
this.suppliersTabPage.Size = new System.Drawing.Size(866, 335);
this.suppliersTabPage.TabIndex = 3;
this.suppliersTabPage.Text = "Suppliers";
this.suppliersTabPage.UseVisualStyleBackColor = true;
//
// suppliersDataGridView
//
this.suppliersDataGridView.AllowUserToAddRows = false;
this.suppliersDataGridView.AllowUserToResizeRows = false;
this.suppliersDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.suppliersDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.suppliersDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.suppliersDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.suppliersDataGridView.Location = new System.Drawing.Point(0, 0);
this.suppliersDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.suppliersDataGridView.Name = "suppliersDataGridView";
this.suppliersDataGridView.ReadOnly = true;
this.suppliersDataGridView.RowTemplate.Height = 28;
this.suppliersDataGridView.ShowEditingIcon = false;
this.suppliersDataGridView.Size = new System.Drawing.Size(866, 335);
this.suppliersDataGridView.TabIndex = 0;
//
// weeklySalesTabPage
//
this.weeklySalesTabPage.Controls.Add(this.weeklySalesDataGridView);
this.weeklySalesTabPage.Location = new System.Drawing.Point(4, 22);
this.weeklySalesTabPage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.weeklySalesTabPage.Name = "weeklySalesTabPage";
this.weeklySalesTabPage.Size = new System.Drawing.Size(866, 335);
this.weeklySalesTabPage.TabIndex = 4;
this.weeklySalesTabPage.Text = "Weekly Sales";
this.weeklySalesTabPage.UseVisualStyleBackColor = true;
//
// weeklySalesDataGridView
//
this.weeklySalesDataGridView.AllowUserToAddRows = false;
this.weeklySalesDataGridView.AllowUserToDeleteRows = false;
this.weeklySalesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.weeklySalesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.weeklySalesDataGridView.Enabled = false;
this.weeklySalesDataGridView.Location = new System.Drawing.Point(0, 0);
this.weeklySalesDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.weeklySalesDataGridView.Name = "weeklySalesDataGridView";
this.weeklySalesDataGridView.ReadOnly = true;
this.weeklySalesDataGridView.RowTemplate.Height = 28;
this.weeklySalesDataGridView.ShowEditingIcon = false;
this.weeklySalesDataGridView.Size = new System.Drawing.Size(866, 335);
this.weeklySalesDataGridView.TabIndex = 0;
//
// secondaryLayOutPanel
//
this.secondaryLayOutPanel.ColumnCount = 3;
this.secondaryLayOutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryLayOutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryLayOutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryLayOutPanel.Controls.Add(this.commmentsGroupBox, 0, 0);
this.secondaryLayOutPanel.Controls.Add(this.datePickerGroupBox, 1, 0);
this.secondaryLayOutPanel.Controls.Add(this.clearSelectedYearGroupBox, 2, 0);
this.secondaryLayOutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.secondaryLayOutPanel.Location = new System.Drawing.Point(2, 403);
this.secondaryLayOutPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.secondaryLayOutPanel.Name = "secondaryLayOutPanel";
this.secondaryLayOutPanel.RowCount = 1;
this.secondaryLayOutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.secondaryLayOutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
this.secondaryLayOutPanel.Size = new System.Drawing.Size(885, 159);
this.secondaryLayOutPanel.TabIndex = 2;
//
// commmentsGroupBox
//
this.commmentsGroupBox.Controls.Add(this.commentsTextBox);
this.commmentsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.commmentsGroupBox.Location = new System.Drawing.Point(2, 2);
this.commmentsGroupBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.commmentsGroupBox.Name = "commmentsGroupBox";
this.commmentsGroupBox.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.commmentsGroupBox.Size = new System.Drawing.Size(291, 155);
this.commmentsGroupBox.TabIndex = 0;
this.commmentsGroupBox.TabStop = false;
this.commmentsGroupBox.Text = "Comments";
//
// commentsTextBox
//
this.commentsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.commentsTextBox.Location = new System.Drawing.Point(2, 15);
this.commentsTextBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.commentsTextBox.Multiline = true;
this.commentsTextBox.Name = "commentsTextBox";
this.commentsTextBox.Size = new System.Drawing.Size(287, 138);
this.commentsTextBox.TabIndex = 0;
//
// datePickerGroupBox
//
this.datePickerGroupBox.Controls.Add(this.informationLabel);
this.datePickerGroupBox.Controls.Add(this.dateSelectorFormatLable);
this.datePickerGroupBox.Controls.Add(this.yearComboBox);
this.datePickerGroupBox.Controls.Add(this.monthComboBox);
this.datePickerGroupBox.Controls.Add(this.dayComboBox);
this.datePickerGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.datePickerGroupBox.Location = new System.Drawing.Point(297, 2);
this.datePickerGroupBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.datePickerGroupBox.Name = "datePickerGroupBox";
this.datePickerGroupBox.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.datePickerGroupBox.Size = new System.Drawing.Size(291, 155);
this.datePickerGroupBox.TabIndex = 1;
this.datePickerGroupBox.TabStop = false;
this.datePickerGroupBox.Text = "Select A Date:";
//
// informationLabel
//
this.informationLabel.AutoSize = true;
this.informationLabel.Location = new System.Drawing.Point(1, 110);
this.informationLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.informationLabel.Name = "informationLabel";
this.informationLabel.Size = new System.Drawing.Size(0, 13);
this.informationLabel.TabIndex = 4;
//
// dateSelectorFormatLable
//
this.dateSelectorFormatLable.AutoSize = true;
this.dateSelectorFormatLable.Location = new System.Drawing.Point(84, 32);
this.dateSelectorFormatLable.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.dateSelectorFormatLable.Name = "dateSelectorFormatLable";
this.dateSelectorFormatLable.Size = new System.Drawing.Size(91, 13);
this.dateSelectorFormatLable.TabIndex = 3;
this.dateSelectorFormatLable.Text = "MM / DD / YYYY";
//
// yearComboBox
//
this.yearComboBox.FormattingEnabled = true;
this.yearComboBox.Location = new System.Drawing.Point(173, 55);
this.yearComboBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.yearComboBox.Name = "yearComboBox";
this.yearComboBox.Size = new System.Drawing.Size(103, 21);
this.yearComboBox.TabIndex = 2;
//
// monthComboBox
//
this.monthComboBox.FormattingEnabled = true;
this.monthComboBox.Location = new System.Drawing.Point(3, 55);
this.monthComboBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.monthComboBox.Name = "monthComboBox";
this.monthComboBox.Size = new System.Drawing.Size(82, 21);
this.monthComboBox.TabIndex = 1;
//
// dayComboBox
//
this.dayComboBox.FormattingEnabled = true;
this.dayComboBox.Location = new System.Drawing.Point(87, 55);
this.dayComboBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.dayComboBox.Name = "dayComboBox";
this.dayComboBox.Size = new System.Drawing.Size(82, 21);
this.dayComboBox.TabIndex = 0;
//
// clearSelectedYearGroupBox
//
this.clearSelectedYearGroupBox.Controls.Add(this.yearClearingWarningLabel);
this.clearSelectedYearGroupBox.Controls.Add(this.clearSelectedYearInfoLabel);
this.clearSelectedYearGroupBox.Controls.Add(this.DELETE);
this.clearSelectedYearGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.clearSelectedYearGroupBox.Location = new System.Drawing.Point(592, 2);
this.clearSelectedYearGroupBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.clearSelectedYearGroupBox.Name = "clearSelectedYearGroupBox";
this.clearSelectedYearGroupBox.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.clearSelectedYearGroupBox.Size = new System.Drawing.Size(291, 155);
this.clearSelectedYearGroupBox.TabIndex = 2;
this.clearSelectedYearGroupBox.TabStop = false;
//
// yearClearingWarningLabel
//
this.yearClearingWarningLabel.AutoSize = true;
this.yearClearingWarningLabel.ForeColor = System.Drawing.Color.Red;
this.yearClearingWarningLabel.Location = new System.Drawing.Point(69, 72);
this.yearClearingWarningLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.yearClearingWarningLabel.Name = "yearClearingWarningLabel";
this.yearClearingWarningLabel.Size = new System.Drawing.Size(152, 13);
this.yearClearingWarningLabel.TabIndex = 7;
this.yearClearingWarningLabel.Text = "This action cannot be undone!";
//
// clearSelectedYearInfoLabel
//
this.clearSelectedYearInfoLabel.AutoSize = true;
this.clearSelectedYearInfoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clearSelectedYearInfoLabel.Location = new System.Drawing.Point(13, 14);
this.clearSelectedYearInfoLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.clearSelectedYearInfoLabel.Name = "clearSelectedYearInfoLabel";
this.clearSelectedYearInfoLabel.Size = new System.Drawing.Size(279, 34);
this.clearSelectedYearInfoLabel.TabIndex = 6;
this.clearSelectedYearInfoLabel.Text = "Clearing the selected date will remove ALL \r\nentries for that date from the datab" +
"ase.";
//
// DELETE
//
this.DELETE.Location = new System.Drawing.Point(82, 109);
this.DELETE.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.DELETE.Name = "DELETE";
this.DELETE.Size = new System.Drawing.Size(121, 27);
this.DELETE.TabIndex = 5;
this.DELETE.Text = "Clear Selected Date";
this.DELETE.UseVisualStyleBackColor = true;
this.DELETE.Click += new System.EventHandler(this.DELETE_Click);
//
// FrmDeleteRecord
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(889, 564);
this.Controls.Add(this.mainTableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.mainMenu;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(895, 589);
this.MinimumSize = new System.Drawing.Size(895, 589);
this.Name = "FrmDeleteRecord";
this.Text = "Delete Existing Records";
this.Load += new System.EventHandler(this.frmDeleteRecord_Load);
this.mainTableLayoutPanel.ResumeLayout(false);
this.mainTableLayoutPanel.PerformLayout();
this.mainMenu.ResumeLayout(false);
this.mainMenu.PerformLayout();
this.mainTabControl.ResumeLayout(false);
this.projectionsTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.projectionsDataGridView)).EndInit();
this.inventoryTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.inventoryDataGridView)).EndInit();
this.actualTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.actualSalesDataGridView)).EndInit();
this.suppliersTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.suppliersDataGridView)).EndInit();
this.weeklySalesTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.weeklySalesDataGridView)).EndInit();
this.secondaryLayOutPanel.ResumeLayout(false);
this.commmentsGroupBox.ResumeLayout(false);
this.commmentsGroupBox.PerformLayout();
this.datePickerGroupBox.ResumeLayout(false);
this.datePickerGroupBox.PerformLayout();
this.clearSelectedYearGroupBox.ResumeLayout(false);
this.clearSelectedYearGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel mainTableLayoutPanel;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem fileMainMenu;
private System.Windows.Forms.ToolStripMenuItem exitFileMainMenu;
private System.Windows.Forms.TabControl mainTabControl;
private System.Windows.Forms.TabPage projectionsTabPage;
private System.Windows.Forms.TabPage inventoryTabPage;
private System.Windows.Forms.TabPage actualTabPage;
private System.Windows.Forms.TabPage suppliersTabPage;
private System.Windows.Forms.TabPage weeklySalesTabPage;
private System.Windows.Forms.TableLayoutPanel secondaryLayOutPanel;
private System.Windows.Forms.GroupBox commmentsGroupBox;
private System.Windows.Forms.TextBox commentsTextBox;
private System.Windows.Forms.DataGridView projectionsDataGridView;
private System.Windows.Forms.DataGridView inventoryDataGridView;
private System.Windows.Forms.DataGridView actualSalesDataGridView;
private System.Windows.Forms.DataGridView suppliersDataGridView;
private System.Windows.Forms.DataGridView weeklySalesDataGridView;
private System.Windows.Forms.GroupBox datePickerGroupBox;
private System.Windows.Forms.Label dateSelectorFormatLable;
private System.Windows.Forms.ComboBox yearComboBox;
private System.Windows.Forms.ComboBox monthComboBox;
private System.Windows.Forms.ComboBox dayComboBox;
private System.Windows.Forms.Label informationLabel;
private System.Windows.Forms.Button DELETE;
private System.Windows.Forms.GroupBox clearSelectedYearGroupBox;
private System.Windows.Forms.Label yearClearingWarningLabel;
private System.Windows.Forms.Label clearSelectedYearInfoLabel;
}
}
-443
View File
@@ -1,443 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace AdvertsingProfitControl
{
public partial class FrmDeleteRecord : Form
{
readonly FrmLogConsole _console = FrmLogConsole.GetStaticInstance;
private List<string> _gDateStringCollection = new List<string>();
private string _lastComment = "";
public FrmDeleteRecord()
{
InitializeComponent();
}
private void frmDeleteRecord_Load(object sender, EventArgs e)
{
FillDateSuggestionComboBoxes();
BuildAndFillDataGridViews();
//Setup event handlers
projectionsDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
inventoryDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
actualSalesDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
suppliersDataGridView.UserDeletingRow += ClearInvoiceFromDatabaseOnRemoving;
commentsTextBox.Leave += UpdateCommentsOnLeave;
}
/// <summary>
/// Event USed: UserDeletingRow
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ClearInvoiceFromDatabaseOnRemoving(object sender, DataGridViewRowCancelEventArgs e)
{
var dataGridView = (DataGridView) sender;
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
var databaseWriter = new DatabaseWriter(databaseTracker.DatabaseConnectionString);
var dateId = databaseReader.RetrieveDateIdByDateString(monthComboBox.Text + "/" + dayComboBox.Text + "/" + yearComboBox.Text, databaseTracker.DatabaseConnectionString);
if (dateId == 0)
{
informationLabel.Text = "An error has occurred trying to obtain the ID\nfor the date " +
monthComboBox.Text + "/" + dayComboBox.Text + "/" + yearComboBox.Text + ".";
}
var supplierName = dataGridView.Rows[e.Row.Index].Cells[0].EditedFormattedValue.ToString();
var invoiceNumber = dataGridView.Rows[e.Row.Index].Cells[1].EditedFormattedValue.ToString();
var count = databaseWriter.RemoveInvoice(invoiceNumber, dateId.ToString());
if (count == 1)
{
informationLabel.Text = "Successfully removed the invoice from " + supplierName +
" with\nthe invoice number of " + invoiceNumber + ".";
}
else if(count == 0)
{
informationLabel.Text = "Failed to remove the invoice from " + supplierName + " from the database.";
e.Cancel = true;
}
}
/// <summary>
/// Event Used: Leave
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void UpdateCommentsOnLeave(object sender, EventArgs e)
{
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
var datbaseWriter = new DatabaseWriter(databaseTracker.DatabaseConnectionString);
if (commentsTextBox.Text == _lastComment)
{
return;
}
var dateId =
databaseReader.RetrieveDateIdByDateString(monthComboBox.Text + "/" + dayComboBox.Text + "/" +
yearComboBox.Text, databaseTracker.DatabaseConnectionString);
if (dateId == 0){ informationLabel.Text = "unable to find date in database."; return; }
var recordsAffected = datbaseWriter.UpdateCommentsByDateId(commentsTextBox.Text, dateId.ToString());
if (recordsAffected == true)
{
informationLabel.Text = "Successfully updated the comments for the selected date.";
}
else
{
informationLabel.Text = "Failed to update the comments for the selected date.";
}
_lastComment = commentsTextBox.Text;
}
/// <summary>
/// Event Used: UserDeletingRow
/// Clears the record in the row being deleted from the database.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ClearRecordFromDatabaseOnRemoving(object sender, DataGridViewRowCancelEventArgs e)
{
var dataGridView = (DataGridView) sender;
var databaseTracker = new DatabaseTracker();
var databaseWriter = new DatabaseWriter(databaseTracker.DatabaseConnectionString);
var databaseReader = new DatabaseReader();
var dateId = databaseReader.RetrieveDateIdByDateString(monthComboBox.Text + "/" + dayComboBox.Text + "/" + yearComboBox.Text, databaseTracker.DatabaseConnectionString);
var adItemName = e.Row.Cells[0].EditedFormattedValue.ToString();
var adItemId = databaseReader.RetrieveAdItemId(adItemName, databaseTracker.DatabaseConnectionString);
var count = databaseWriter.RemoveRecord(adItemId, dateId.ToString());
if (count == 1)
{
informationLabel.Text = "Successfully removed " + adItemName + " from the database.";
//
projectionsDataGridView.UserDeletingRow -= ClearRecordFromDatabaseOnRemoving;
inventoryDataGridView.UserDeletingRow -= ClearRecordFromDatabaseOnRemoving;
actualSalesDataGridView.UserDeletingRow -= ClearRecordFromDatabaseOnRemoving;
//Maybe make this based on tab page index.
if (dataGridView.Name == "projectionsDataGridView")
{
inventoryDataGridView.Rows.RemoveAt(e.Row.Index);
actualSalesDataGridView.Rows.RemoveAt(e.Row.Index);
}
else if (dataGridView.Name == "inventoryDataGridView")
{
projectionsDataGridView.Rows.RemoveAt(e.Row.Index);
actualSalesDataGridView.Rows.RemoveAt(e.Row.Index);
}
else if (dataGridView.Name == "actualSalesDataGridView")
{
projectionsDataGridView.Rows.RemoveAt(e.Row.Index);
inventoryDataGridView.Rows.RemoveAt(e.Row.Index);
}
}
else
{
informationLabel.Text = "Failed to remove " + adItemName + " from the database.";
e.Cancel = true;
}
projectionsDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
inventoryDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
actualSalesDataGridView.UserDeletingRow += ClearRecordFromDatabaseOnRemoving;
}
private void UpdateDataGridViewInformation(object sender, EventArgs e)
{
string dateString = monthComboBox.Text + "/" + dayComboBox.Text + "/" + yearComboBox.Text;
BuildAndFillDataGridViews(dateString);
}
private void BuildAndFillDataGridViews(string dateString = "")
{
var databaseTracker = new DatabaseTracker();
var dataBaseReader = new DatabaseReader();
int dateId;
//Check to see if a parameter has been passed.
if (dateString == "")
{
//IF non were, then grab the most recent date ID from the database and use that.
dateId = dataBaseReader.RetrieveMostRecentDateId(databaseTracker.DatabaseConnectionString);
_console.WriteToLog(FrmLogConsole.Level.Info, dateId != 0 ? "Most recent date ID is " + dateId : "Most recent date ID is unavailable.");
}
else
{
//ELSE IF one was passed, then use it's ID to build the tables.
dateId = dataBaseReader.RetrieveDateIdByDateString(dateString, databaseTracker.DatabaseConnectionString);
_console.WriteToLog(FrmLogConsole.Level.Info, dateId != 0 ? "Date ID for " + dateString + " is resolved to have the ID of " + dateId + "." : "The date " + dateString + " could not be found in the database.");
if (dateId == 0)
{
_gDateStringCollection.Remove(dateString);
}
}
//Now check to make sure there were no errors grabbing the ID, IF there were return.
if (dateId == 0) return;
//Clear all DataGridViews since the date supplied is valid and in the database.
projectionsDataGridView.DataSource = null;
inventoryDataGridView.DataSource = null;
actualSalesDataGridView.DataSource = null;
suppliersDataGridView.DataSource = null;
weeklySalesDataGridView.DataSource = null;
//Fill the tables from the database.
projectionsDataGridView.DataSource = CleanDataTable(dataBaseReader.ReturnProjectionsTable(dateId, databaseTracker.DatabaseConnectionString));
inventoryDataGridView.DataSource = CleanDataTable(dataBaseReader.ReturnInventoryTable(dateId, databaseTracker.DatabaseConnectionString));
actualSalesDataGridView.DataSource = CleanDataTable(dataBaseReader.ReturnActualSales(dateId, databaseTracker.DatabaseConnectionString));
suppliersDataGridView.DataSource = dataBaseReader.ReturnInvoiceTable(dateId, databaseTracker.DatabaseConnectionString);
weeklySalesDataGridView.DataSource = dataBaseReader.ReturnWeeklySalesFromDateId(dateId, databaseTracker.DatabaseConnectionString);
commentsTextBox.Text = dataBaseReader.RetrieveComments(dateId, databaseTracker.DatabaseConnectionString)[1];
if (commentsTextBox.Text.StartsWith("No comments"))
{
commentsTextBox.Enabled = false;
}
else
{
commentsTextBox.Enabled = true;
_lastComment = commentsTextBox.Text;
}
}
private DataTable CleanDataTable(DataTable table)
{
if (table.Columns[table.Columns.Count - 1].ColumnName == "FK_GroupID")
{
table.Columns.RemoveAt(table.Columns.Count - 1);
}
var cleanedTable = table;
return cleanedTable;
}
/// <summary>
/// Grabs all dates from the database and splits the returned strings
/// into months, days, and years and stores them in their respective
/// combo boxes to display to the user. Also stores the list of dates
/// inside a class wide variable.
/// </summary>
private void FillDateSuggestionComboBoxes()
{
//Create a connection to the database reader class.
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
//Grab the most recent date in the database.
var mostRecentDateTime = databaseReader.RetrieveMostRecentDateString(databaseTracker.DatabaseConnectionString);
var mostRecentDateString = mostRecentDateTime.ToString("MM/dd/yyyy");
//Check to see if the return value is null and IF so log the error and return.
if (mostRecentDateString == "") { _console.WriteToLog(FrmLogConsole.Level.Error, "No dates could be found in the database."); return; }
//Otherwise, if there was a return date, split it into a array.
var mostRecentDateParts = mostRecentDateString.Split('/');
//Grab only the most recent years in the database (only say 2015) and fill a table with the dates. Indexes are as follows: [0] is Month, [1] is Day and [2] is Year.
List<DateTime> dateList = databaseReader.RetrieveDateListByYear(mostRecentDateParts[2].ToString(), databaseTracker.DatabaseConnectionString);
//Suspend the control's drawing so the user doesn't see any ugly enumeration and index changing.
DrawingControl.SuspendDrawing(secondaryLayOutPanel);
//Considering there was a return value for the most recent date, its safe to assume there is at least one date in the database, so clear the class's date collection.
_gDateStringCollection.Clear();
monthComboBox.Items.Clear();
dayComboBox.Items.Clear();
yearComboBox.Items.Clear();
monthComboBox.SelectedIndexChanged -= UpdateDaysOfMonth;
dayComboBox.SelectedIndexChanged -= UpdateDataGridViewInformation;
yearComboBox.SelectedIndexChanged -= UpdateDaysOfMonthByYear;
//Now spin through the oneYearDatesTable and fill the class wide object with all the dates for the most recent year.
for (var i = 0; i < dateList.Count; i++)
{
var fullDateString = dateList[i].ToString("MM/dd/yyyy");
//Check for nulls just to be paranoid.
if (fullDateString == "")
{
return;
}
//IF the date string collection already contains the date, then continue to the next iteration.
if (_gDateStringCollection.Contains(fullDateString))
{
continue;
}
_gDateStringCollection.Add(fullDateString);
}
var dayBasedOnMonthAndYeaRegex = new Regex("^0?" + mostRecentDateParts[0] + @"/\d{2}/" + mostRecentDateParts[2]);
var monthBasedOnYearRegex = new Regex(@"^\d{2}/\d{2}/" + mostRecentDateParts[2]);
for (var i = 0; i < _gDateStringCollection.Count; i++)
{
string[] dateArray = _gDateStringCollection[i].Split('/');
var month = dateArray[0];
var day = dateArray[1];
if (dayBasedOnMonthAndYeaRegex.IsMatch(_gDateStringCollection[i]))
{
dayComboBox.Items.Add(day);
}
if (monthBasedOnYearRegex.IsMatch(_gDateStringCollection[i]))
{
if (!monthComboBox.Items.Contains(month))
{
monthComboBox.Items.Add(month);
}
}
}
var yearsInDatabase = databaseReader.RetrieveUniqueYearsList(databaseTracker.DatabaseConnectionString);
foreach (var year in yearsInDatabase)
{
yearComboBox.Items.Add(year);
}
if (dayComboBox.Items.Count >= 1 && yearComboBox.Items.Count >= 1 && monthComboBox.Items.Count >= 1)
{
monthComboBox.SelectedIndex = monthComboBox.Items.Count - 1;
dayComboBox.SelectedIndex = dayComboBox.Items.Count - 1;
yearComboBox.SelectedIndex = yearComboBox.Items.Count - 1;
monthComboBox.Enabled = true;
dayComboBox.Enabled = true;
yearComboBox.Enabled = true;
}
else
{
monthComboBox.Enabled = false;
dayComboBox.Enabled = false;
yearComboBox.Enabled = false;
}
monthComboBox.SelectedIndexChanged += UpdateDaysOfMonth;
dayComboBox.SelectedIndexChanged += UpdateDataGridViewInformation;
yearComboBox.SelectedIndexChanged += UpdateDaysOfMonthByYear;
DrawingControl.ResumeDrawing(secondaryLayOutPanel);
}
private void UpdateDaysOfMonth(object sender, EventArgs e)
{
if (yearComboBox.SelectedIndex == -1) return;
var year = yearComboBox.SelectedItem.ToString();
var month = monthComboBox.SelectedItem.ToString();
var dateParserPattern = new Regex("^" + month + @"\/\d{2}\/" + year);
dayComboBox.Items.Clear();
for (var i = 0; i < _gDateStringCollection.Count; i++)
{
if (dateParserPattern.IsMatch(_gDateStringCollection[i]))
{
var dateArray = _gDateStringCollection[i].Split('/');
var day = dateArray[1];
dayComboBox.Items.Add(day);
}
}
if (dayComboBox.Items.Count > 0)
{
dayComboBox.SelectedIndex = dayComboBox.Items.Count - 1;
}
}
/// <summary>
/// Fires when the Year combo box's index changes.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void UpdateDaysOfMonthByYear(object sender, EventArgs e)
{
//Obligatory database retrieval call...
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
//First, grab the year and the month from their respective combo boxes.
var year = yearComboBox.SelectedItem.ToString();
var month = monthComboBox.SelectedItem.ToString();
//Since we can more or less be certain that nothing is null, clear the current date collection.
_gDateStringCollection.Clear();
var months = databaseReader.RetrieveUniqueMonthsList(year, databaseTracker.DatabaseConnectionString);
var mostRecentMonth = months.Max();
if (mostRecentMonth.Length == 1)
{
mostRecentMonth = "0" + mostRecentMonth;
}
var dateList = databaseReader.RetrieveDateListByYear(year, databaseTracker.DatabaseConnectionString);
foreach (var t in dateList)
{
_gDateStringCollection.Add(t.ToString("MM/dd/yyyy"));
}
//Clear the month and day combo boxes and unregister their event handlers.
dayComboBox.Items.Clear();
monthComboBox.Items.Clear();
monthComboBox.SelectedIndexChanged -= UpdateDaysOfMonth;
dayComboBox.SelectedIndexChanged -= UpdateDataGridViewInformation;
for (var i = 0; i < _gDateStringCollection.Count; i++)
{
var dateArray = _gDateStringCollection[i].Split('/');
month = dateArray[0];
//Declare the patterns to look for when enumerating the combo boxes.
var dayBasedOnMonthAndYeaRegex = new Regex(@"^(" + mostRecentMonth + @"\/\d{2}\/" + year + ")"); //Only allows days that are actually part of the month and year.
var day = dateArray[1];
if (dayBasedOnMonthAndYeaRegex.IsMatch(_gDateStringCollection[i]))
{
dayComboBox.Items.Add(day);
}
if (!monthComboBox.Items.Contains(month))
{
monthComboBox.Items.Add(month);
}
}
if (dayComboBox.Items.Count > 0)
{
dayComboBox.SelectedIndex = dayComboBox.Items.Count - 1;
}
if (monthComboBox.Items.Count > 0)
{
monthComboBox.SelectedIndex = monthComboBox.Items.Count - 1;
}
//Now re-register the event handlers
monthComboBox.SelectedIndexChanged += UpdateDaysOfMonth;
dayComboBox.SelectedIndexChanged += UpdateDataGridViewInformation;
BuildAndFillDataGridViews(monthComboBox.SelectedItem + "/" + dayComboBox.SelectedItem + "/" + year);
}
private void DELETE_Click(object sender, EventArgs e)
{
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
var databaseWriter = new DatabaseWriter(databaseTracker.DatabaseConnectionString);
var result = MessageBox.Show("Are you sure you wish to delete all records for the date selected date (" + monthComboBox.Text +"/" + dayComboBox.Text + "/" + yearComboBox.Text + ")?\nThis cannot be undone.", "Purge Selected Year", MessageBoxButtons.YesNo)
;
if (result == DialogResult.Yes)
{
var dateId =
databaseReader.RetrieveDateIdByDateString(monthComboBox.Text + "/" + dayComboBox.Text + "/" +
yearComboBox.Text, databaseTracker.DatabaseConnectionString);
var recordsAffected = databaseWriter.RemoveAllEntriesAndYearById(dateId.ToString());
if (recordsAffected > 0)
{
informationLabel.Text = "Successfully removed " + recordsAffected.ToString() +
" entries clearing all records of\n" + monthComboBox.Text + "/" + dayComboBox.Text +
"/" + yearComboBox.Text + " from the database.";
}
}
else
{
return;
}
FillDateSuggestionComboBoxes();
BuildAndFillDataGridViews();
}
}
}
File diff suppressed because it is too large Load Diff
+9 -22
View File
@@ -36,10 +36,10 @@
this.recordsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addRecordsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.modifyRecordMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.deleteRecordsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.toolsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.adSpecialKeyWordsToolsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.manageItemsToolsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.clearSelectedDateToolsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.helpMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.showHideConsoleHelpMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.dbVersionHelpMainMenu = new System.Windows.Forms.ToolStripMenuItem();
@@ -102,7 +102,6 @@
this.grossProfitEstimatedWeeklyDeptmartmentExpenseLabel = new System.Windows.Forms.Label();
this.perfectGrossProfitLabel = new System.Windows.Forms.Label();
this.grossProfitDollarGrossProfitLabel = new System.Windows.Forms.Label();
this.clearSelectedDateToolsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
this.mainMenu.SuspendLayout();
this.mainTableLayoutPanel.SuspendLayout();
this.commentMainTableLayoutPanel.SuspendLayout();
@@ -173,8 +172,7 @@
//
this.recordsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addRecordsToolStripMenuItem,
this.modifyRecordMainMenu,
this.deleteRecordsMainMenu});
this.modifyRecordMainMenu});
this.recordsToolStripMenuItem.Name = "recordsToolStripMenuItem";
this.recordsToolStripMenuItem.Size = new System.Drawing.Size(98, 34);
this.recordsToolStripMenuItem.Text = "&Records";
@@ -193,16 +191,6 @@
this.modifyRecordMainMenu.Text = "&Modify Existing Record ";
this.modifyRecordMainMenu.Click += new System.EventHandler(this.modifyRecordMainMenu_Click);
//
// deleteRecordsMainMenu
//
this.deleteRecordsMainMenu.Enabled = false;
this.deleteRecordsMainMenu.Name = "deleteRecordsMainMenu";
this.deleteRecordsMainMenu.Size = new System.Drawing.Size(323, 34);
this.deleteRecordsMainMenu.Text = "&Delete Existing record";
this.deleteRecordsMainMenu.ToolTipText = "Currently Unavailable in this Version.";
this.deleteRecordsMainMenu.Visible = false;
this.deleteRecordsMainMenu.Click += new System.EventHandler(this.deleteRecordsMainMenu_Click);
//
// toolsMainMenu
//
this.toolsMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -228,6 +216,13 @@
this.manageItemsToolsMainMenu.Visible = false;
this.manageItemsToolsMainMenu.Click += new System.EventHandler(this.manageItemsToolsMainMenu_Click);
//
// clearSelectedDateToolsMainMenu
//
this.clearSelectedDateToolsMainMenu.Name = "clearSelectedDateToolsMainMenu";
this.clearSelectedDateToolsMainMenu.Size = new System.Drawing.Size(286, 34);
this.clearSelectedDateToolsMainMenu.Text = "&Clear Selected Date";
this.clearSelectedDateToolsMainMenu.Click += new System.EventHandler(this.clearSelectedDateToolsMainMenu_Click);
//
// helpMainMenu
//
this.helpMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -931,13 +926,6 @@
this.grossProfitDollarGrossProfitLabel.TabIndex = 2;
this.grossProfitDollarGrossProfitLabel.Text = "Dollar Gross Profit: ";
//
// clearSelectedDateToolsMainMenu
//
this.clearSelectedDateToolsMainMenu.Name = "clearSelectedDateToolsMainMenu";
this.clearSelectedDateToolsMainMenu.Size = new System.Drawing.Size(286, 34);
this.clearSelectedDateToolsMainMenu.Text = "&Clear Selected Date";
this.clearSelectedDateToolsMainMenu.Click += new System.EventHandler(this.clearSelectedDateToolsMainMenu_Click);
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(168F, 168F);
@@ -1011,7 +999,6 @@
private System.Windows.Forms.ToolStripMenuItem recordsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addRecordsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem modifyRecordMainMenu;
private System.Windows.Forms.ToolStripMenuItem deleteRecordsMainMenu;
private System.Windows.Forms.ToolStripMenuItem toolsMainMenu;
private System.Windows.Forms.ToolStripMenuItem adSpecialKeyWordsToolsMainMenu;
private System.Windows.Forms.ToolStripMenuItem manageItemsToolsMainMenu;
-15
View File
@@ -147,14 +147,6 @@ namespace AdvertsingProfitControl
}
}
private void deleteRecordsMainMenu_Click(object sender, EventArgs e)
{
var frmDeleteRecord = new FrmDeleteRecord();
frmDeleteRecord.ShowDialog();
CalculateProfitAnalysis();
CalculateGrossProfit();
}
private void modifyRecordMainMenu_Click(object sender, EventArgs e)
{
var form = new NewModifyRecord(_currentActiveDate);
@@ -261,13 +253,6 @@ namespace AdvertsingProfitControl
printDialog.Document = new PrintDocument();
}
public enum FormRoll
{
AddRecords = 0,
ModifyRecords = 1,
DeleteRecords = 2
}
/// <summary>
/// Fills the APC DataGridViews with the appropriate columns and starting row for the user to start
/// entering data.
-448
View File
@@ -1,448 +0,0 @@
namespace AdvertsingProfitControl
{
partial class FrmModifyRecord
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmModifyRecord));
this.mainTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.mainMenu = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.getAttributeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.projectionsTabpage = new System.Windows.Forms.TabPage();
this.projectionsDataGridView = new System.Windows.Forms.DataGridView();
this.inventoryTabPage = new System.Windows.Forms.TabPage();
this.inventoryDataGridView = new System.Windows.Forms.DataGridView();
this.actualSalesTabPage = new System.Windows.Forms.TabPage();
this.actualSalesDataGridView = new System.Windows.Forms.DataGridView();
this.invoicesTabPage = new System.Windows.Forms.TabPage();
this.invoicesDataGridView = new System.Windows.Forms.DataGridView();
this.weeklySalesTabPage = new System.Windows.Forms.TabPage();
this.weeklySalesDataGridView = new System.Windows.Forms.DataGridView();
this.secondaryTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.commentsGroupBox = new System.Windows.Forms.GroupBox();
this.commentsTextBox = new System.Windows.Forms.TextBox();
this.dateSelectorGroupBox = new System.Windows.Forms.GroupBox();
this.updateRecords = new System.Windows.Forms.Button();
this.notificationLabel = new System.Windows.Forms.Label();
this.yearComboBox = new System.Windows.Forms.ComboBox();
this.dayComboBox = new System.Windows.Forms.ComboBox();
this.monthComboBox = new System.Windows.Forms.ComboBox();
this.mainTableLayoutPanel.SuspendLayout();
this.mainMenu.SuspendLayout();
this.mainTabControl.SuspendLayout();
this.projectionsTabpage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.projectionsDataGridView)).BeginInit();
this.inventoryTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.inventoryDataGridView)).BeginInit();
this.actualSalesTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.actualSalesDataGridView)).BeginInit();
this.invoicesTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.invoicesDataGridView)).BeginInit();
this.weeklySalesTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.weeklySalesDataGridView)).BeginInit();
this.secondaryTableLayoutPanel.SuspendLayout();
this.commentsGroupBox.SuspendLayout();
this.dateSelectorGroupBox.SuspendLayout();
this.SuspendLayout();
//
// mainTableLayoutPanel
//
this.mainTableLayoutPanel.ColumnCount = 1;
this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.mainTableLayoutPanel.Controls.Add(this.mainMenu, 0, 0);
this.mainTableLayoutPanel.Controls.Add(this.mainTabControl, 0, 1);
this.mainTableLayoutPanel.Controls.Add(this.secondaryTableLayoutPanel, 0, 2);
this.mainTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.mainTableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.mainTableLayoutPanel.Name = "mainTableLayoutPanel";
this.mainTableLayoutPanel.RowCount = 3;
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.mainTableLayoutPanel.Size = new System.Drawing.Size(1180, 712);
this.mainTableLayoutPanel.TabIndex = 0;
//
// mainMenu
//
this.mainMenu.ImageScalingSize = new System.Drawing.Size(24, 24);
this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.debugToolStripMenuItem});
this.mainMenu.Location = new System.Drawing.Point(0, 0);
this.mainMenu.Name = "mainMenu";
this.mainMenu.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3);
this.mainMenu.Size = new System.Drawing.Size(1180, 35);
this.mainMenu.TabIndex = 0;
this.mainMenu.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29);
this.fileToolStripMenuItem.Text = "&File";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(187, 30);
this.exitToolStripMenuItem.Text = "&Close Form";
//
// debugToolStripMenuItem
//
this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.getAttributeToolStripMenuItem});
this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
this.debugToolStripMenuItem.Size = new System.Drawing.Size(78, 29);
this.debugToolStripMenuItem.Text = "Debug";
//
// getAttributeToolStripMenuItem
//
this.getAttributeToolStripMenuItem.Name = "getAttributeToolStripMenuItem";
this.getAttributeToolStripMenuItem.Size = new System.Drawing.Size(211, 30);
this.getAttributeToolStripMenuItem.Text = "Get Attribute";
this.getAttributeToolStripMenuItem.Click += new System.EventHandler(this.getAttributeToolStripMenuItem_Click);
//
// mainTabControl
//
this.mainTabControl.Controls.Add(this.projectionsTabpage);
this.mainTabControl.Controls.Add(this.inventoryTabPage);
this.mainTabControl.Controls.Add(this.actualSalesTabPage);
this.mainTabControl.Controls.Add(this.invoicesTabPage);
this.mainTabControl.Controls.Add(this.weeklySalesTabPage);
this.mainTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainTabControl.Location = new System.Drawing.Point(4, 43);
this.mainTabControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.mainTabControl.Name = "mainTabControl";
this.mainTabControl.SelectedIndex = 0;
this.mainTabControl.Size = new System.Drawing.Size(1172, 461);
this.mainTabControl.TabIndex = 1;
//
// projectionsTabpage
//
this.projectionsTabpage.Controls.Add(this.projectionsDataGridView);
this.projectionsTabpage.Location = new System.Drawing.Point(4, 29);
this.projectionsTabpage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.projectionsTabpage.Name = "projectionsTabpage";
this.projectionsTabpage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.projectionsTabpage.Size = new System.Drawing.Size(1164, 428);
this.projectionsTabpage.TabIndex = 0;
this.projectionsTabpage.Text = "Projections";
this.projectionsTabpage.UseVisualStyleBackColor = true;
//
// projectionsDataGridView
//
this.projectionsDataGridView.AllowDrop = true;
this.projectionsDataGridView.AllowUserToResizeRows = false;
this.projectionsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.projectionsDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.projectionsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.projectionsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.projectionsDataGridView.Location = new System.Drawing.Point(4, 5);
this.projectionsDataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.projectionsDataGridView.MultiSelect = false;
this.projectionsDataGridView.Name = "projectionsDataGridView";
this.projectionsDataGridView.Size = new System.Drawing.Size(1156, 418);
this.projectionsDataGridView.TabIndex = 0;
//
// inventoryTabPage
//
this.inventoryTabPage.Controls.Add(this.inventoryDataGridView);
this.inventoryTabPage.Location = new System.Drawing.Point(4, 29);
this.inventoryTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.inventoryTabPage.Name = "inventoryTabPage";
this.inventoryTabPage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.inventoryTabPage.Size = new System.Drawing.Size(1164, 428);
this.inventoryTabPage.TabIndex = 1;
this.inventoryTabPage.Text = "Inventory";
this.inventoryTabPage.UseVisualStyleBackColor = true;
//
// inventoryDataGridView
//
this.inventoryDataGridView.AllowDrop = true;
this.inventoryDataGridView.AllowUserToResizeRows = false;
this.inventoryDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.inventoryDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.inventoryDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.inventoryDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.inventoryDataGridView.Location = new System.Drawing.Point(4, 5);
this.inventoryDataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.inventoryDataGridView.MultiSelect = false;
this.inventoryDataGridView.Name = "inventoryDataGridView";
this.inventoryDataGridView.Size = new System.Drawing.Size(1156, 418);
this.inventoryDataGridView.TabIndex = 0;
//
// actualSalesTabPage
//
this.actualSalesTabPage.Controls.Add(this.actualSalesDataGridView);
this.actualSalesTabPage.Location = new System.Drawing.Point(4, 29);
this.actualSalesTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.actualSalesTabPage.Name = "actualSalesTabPage";
this.actualSalesTabPage.Size = new System.Drawing.Size(1164, 428);
this.actualSalesTabPage.TabIndex = 2;
this.actualSalesTabPage.Text = "Actual Sales";
this.actualSalesTabPage.UseVisualStyleBackColor = true;
//
// actualSalesDataGridView
//
this.actualSalesDataGridView.AllowDrop = true;
this.actualSalesDataGridView.AllowUserToResizeRows = false;
this.actualSalesDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.actualSalesDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.actualSalesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.actualSalesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.actualSalesDataGridView.Location = new System.Drawing.Point(0, 0);
this.actualSalesDataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.actualSalesDataGridView.MultiSelect = false;
this.actualSalesDataGridView.Name = "actualSalesDataGridView";
this.actualSalesDataGridView.Size = new System.Drawing.Size(1164, 428);
this.actualSalesDataGridView.TabIndex = 0;
//
// invoicesTabPage
//
this.invoicesTabPage.Controls.Add(this.invoicesDataGridView);
this.invoicesTabPage.Location = new System.Drawing.Point(4, 29);
this.invoicesTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.invoicesTabPage.Name = "invoicesTabPage";
this.invoicesTabPage.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.invoicesTabPage.Size = new System.Drawing.Size(1164, 428);
this.invoicesTabPage.TabIndex = 4;
this.invoicesTabPage.Text = "Invoices";
this.invoicesTabPage.UseVisualStyleBackColor = true;
//
// invoicesDataGridView
//
this.invoicesDataGridView.AllowUserToResizeRows = false;
this.invoicesDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.invoicesDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.invoicesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.invoicesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.invoicesDataGridView.Location = new System.Drawing.Point(4, 5);
this.invoicesDataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.invoicesDataGridView.MultiSelect = false;
this.invoicesDataGridView.Name = "invoicesDataGridView";
this.invoicesDataGridView.Size = new System.Drawing.Size(1156, 418);
this.invoicesDataGridView.TabIndex = 0;
//
// weeklySalesTabPage
//
this.weeklySalesTabPage.Controls.Add(this.weeklySalesDataGridView);
this.weeklySalesTabPage.Location = new System.Drawing.Point(4, 29);
this.weeklySalesTabPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.weeklySalesTabPage.Name = "weeklySalesTabPage";
this.weeklySalesTabPage.Size = new System.Drawing.Size(1164, 428);
this.weeklySalesTabPage.TabIndex = 3;
this.weeklySalesTabPage.Text = "Weekly Sales";
this.weeklySalesTabPage.UseVisualStyleBackColor = true;
//
// weeklySalesDataGridView
//
this.weeklySalesDataGridView.AllowUserToAddRows = false;
this.weeklySalesDataGridView.AllowUserToDeleteRows = false;
this.weeklySalesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.weeklySalesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
this.weeklySalesDataGridView.Location = new System.Drawing.Point(0, 0);
this.weeklySalesDataGridView.MultiSelect = false;
this.weeklySalesDataGridView.Name = "weeklySalesDataGridView";
this.weeklySalesDataGridView.RowTemplate.Height = 28;
this.weeklySalesDataGridView.Size = new System.Drawing.Size(1164, 428);
this.weeklySalesDataGridView.TabIndex = 0;
//
// secondaryTableLayoutPanel
//
this.secondaryTableLayoutPanel.ColumnCount = 3;
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.secondaryTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.secondaryTableLayoutPanel.Controls.Add(this.commentsGroupBox, 0, 0);
this.secondaryTableLayoutPanel.Controls.Add(this.dateSelectorGroupBox, 1, 0);
this.secondaryTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.secondaryTableLayoutPanel.Location = new System.Drawing.Point(4, 514);
this.secondaryTableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.secondaryTableLayoutPanel.Name = "secondaryTableLayoutPanel";
this.secondaryTableLayoutPanel.RowCount = 1;
this.secondaryTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.secondaryTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.secondaryTableLayoutPanel.Size = new System.Drawing.Size(1172, 193);
this.secondaryTableLayoutPanel.TabIndex = 2;
//
// commentsGroupBox
//
this.commentsGroupBox.Controls.Add(this.commentsTextBox);
this.commentsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.commentsGroupBox.Location = new System.Drawing.Point(3, 3);
this.commentsGroupBox.Name = "commentsGroupBox";
this.commentsGroupBox.Size = new System.Drawing.Size(384, 187);
this.commentsGroupBox.TabIndex = 0;
this.commentsGroupBox.TabStop = false;
this.commentsGroupBox.Text = "Comments";
//
// commentsTextBox
//
this.commentsTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.commentsTextBox.Location = new System.Drawing.Point(3, 22);
this.commentsTextBox.Multiline = true;
this.commentsTextBox.Name = "commentsTextBox";
this.commentsTextBox.Size = new System.Drawing.Size(378, 162);
this.commentsTextBox.TabIndex = 0;
//
// dateSelectorGroupBox
//
this.secondaryTableLayoutPanel.SetColumnSpan(this.dateSelectorGroupBox, 2);
this.dateSelectorGroupBox.Controls.Add(this.updateRecords);
this.dateSelectorGroupBox.Controls.Add(this.notificationLabel);
this.dateSelectorGroupBox.Controls.Add(this.yearComboBox);
this.dateSelectorGroupBox.Controls.Add(this.dayComboBox);
this.dateSelectorGroupBox.Controls.Add(this.monthComboBox);
this.dateSelectorGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.dateSelectorGroupBox.Location = new System.Drawing.Point(393, 3);
this.dateSelectorGroupBox.Name = "dateSelectorGroupBox";
this.dateSelectorGroupBox.Size = new System.Drawing.Size(776, 187);
this.dateSelectorGroupBox.TabIndex = 1;
this.dateSelectorGroupBox.TabStop = false;
this.dateSelectorGroupBox.Text = "Select a date to modify:";
//
// updateRecords
//
this.updateRecords.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.updateRecords.Location = new System.Drawing.Point(598, 143);
this.updateRecords.Name = "updateRecords";
this.updateRecords.Size = new System.Drawing.Size(178, 40);
this.updateRecords.TabIndex = 2;
this.updateRecords.Text = "Update Records";
this.updateRecords.UseVisualStyleBackColor = true;
this.updateRecords.Click += new System.EventHandler(this.addRecords_Click);
//
// notificationLabel
//
this.notificationLabel.AutoSize = true;
this.notificationLabel.Location = new System.Drawing.Point(6, 105);
this.notificationLabel.Name = "notificationLabel";
this.notificationLabel.Size = new System.Drawing.Size(0, 20);
this.notificationLabel.TabIndex = 3;
//
// yearComboBox
//
this.yearComboBox.FormattingEnabled = true;
this.yearComboBox.Location = new System.Drawing.Point(256, 62);
this.yearComboBox.Name = "yearComboBox";
this.yearComboBox.Size = new System.Drawing.Size(121, 28);
this.yearComboBox.TabIndex = 2;
//
// dayComboBox
//
this.dayComboBox.FormattingEnabled = true;
this.dayComboBox.Location = new System.Drawing.Point(129, 62);
this.dayComboBox.Name = "dayComboBox";
this.dayComboBox.Size = new System.Drawing.Size(121, 28);
this.dayComboBox.TabIndex = 1;
//
// monthComboBox
//
this.monthComboBox.FormattingEnabled = true;
this.monthComboBox.Location = new System.Drawing.Point(2, 62);
this.monthComboBox.Name = "monthComboBox";
this.monthComboBox.Size = new System.Drawing.Size(121, 28);
this.monthComboBox.TabIndex = 0;
//
// FrmModifyRecord
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1180, 712);
this.Controls.Add(this.mainTableLayoutPanel);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.mainMenu;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximumSize = new System.Drawing.Size(1332, 878);
this.MinimumSize = new System.Drawing.Size(1182, 724);
this.Name = "FrmModifyRecord";
this.Text = "Modify Existing Records";
this.Load += new System.EventHandler(this.FrmModifyRecord_Load);
this.mainTableLayoutPanel.ResumeLayout(false);
this.mainTableLayoutPanel.PerformLayout();
this.mainMenu.ResumeLayout(false);
this.mainMenu.PerformLayout();
this.mainTabControl.ResumeLayout(false);
this.projectionsTabpage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.projectionsDataGridView)).EndInit();
this.inventoryTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.inventoryDataGridView)).EndInit();
this.actualSalesTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.actualSalesDataGridView)).EndInit();
this.invoicesTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.invoicesDataGridView)).EndInit();
this.weeklySalesTabPage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.weeklySalesDataGridView)).EndInit();
this.secondaryTableLayoutPanel.ResumeLayout(false);
this.commentsGroupBox.ResumeLayout(false);
this.commentsGroupBox.PerformLayout();
this.dateSelectorGroupBox.ResumeLayout(false);
this.dateSelectorGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel mainTableLayoutPanel;
private System.Windows.Forms.MenuStrip mainMenu;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.TabControl mainTabControl;
private System.Windows.Forms.TabPage projectionsTabpage;
private System.Windows.Forms.DataGridView projectionsDataGridView;
private System.Windows.Forms.TabPage inventoryTabPage;
private System.Windows.Forms.DataGridView inventoryDataGridView;
private System.Windows.Forms.TabPage actualSalesTabPage;
private System.Windows.Forms.DataGridView actualSalesDataGridView;
private System.Windows.Forms.TabPage weeklySalesTabPage;
private System.Windows.Forms.TableLayoutPanel secondaryTableLayoutPanel;
private System.Windows.Forms.TabPage invoicesTabPage;
private System.Windows.Forms.DataGridView invoicesDataGridView;
private System.Windows.Forms.GroupBox commentsGroupBox;
private System.Windows.Forms.TextBox commentsTextBox;
private System.Windows.Forms.GroupBox dateSelectorGroupBox;
private System.Windows.Forms.ComboBox yearComboBox;
private System.Windows.Forms.ComboBox dayComboBox;
private System.Windows.Forms.ComboBox monthComboBox;
private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem getAttributeToolStripMenuItem;
private System.Windows.Forms.Label notificationLabel;
private System.Windows.Forms.Button updateRecords;
private System.Windows.Forms.DataGridView weeklySalesDataGridView;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+111 -29
View File
@@ -550,7 +550,6 @@ namespace AdvertsingProfitControl
{
var table = ((DataGridView)sender);
table.Rows[e.RowIndex].HeaderCell.Value = (e.RowIndex + 1).ToString();
LogConsole.WriteToLog(FrmLogConsole.Level.Info, "Added row at Index " + e.RowIndex + " in " + table.Name + ".");
}
/// <summary>
@@ -596,12 +595,6 @@ namespace AdvertsingProfitControl
//Add in used Ad Items to the list.
if (userInput == string.Empty) return;
//Clear the old ad item out of the used ad item collection.
var parser = new RowParsing();
if (parser.GetRowAttribute(dataGridView.Rows[e.RowIndex]) == RowAttribute.AdSpecialRow)
{
_adSpecialIndex = e.RowIndex;
return;
}
//Section one (1) detected.
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
{
@@ -609,7 +602,7 @@ namespace AdvertsingProfitControl
_usedAdItems[0].Add(userInput);
}
//Section two (2) detected.
else
else if(e.RowIndex > _adSpecialIndex)
{
if (_usedAdItems[1].Contains(userInput)) return;
_usedAdItems[1].Add(userInput);
@@ -698,22 +691,35 @@ namespace AdvertsingProfitControl
int inventoryRowId;
int actualSalesRowId;
//Attempt to delete the row from the database by its ID number.
int.TryParse(projectionsDataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.Id].EditedFormattedValue.ToString(), out projectionsRowId);
int.TryParse(inventoryDataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.Id].EditedFormattedValue.ToString(), out inventoryRowId);
int.TryParse(actualSalesDataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.Id].EditedFormattedValue.ToString(), out actualSalesRowId);
int.TryParse(
projectionsDataGridView.Rows[currentRowIndex].Cells[(int) SalesTableColumns.Id]
.EditedFormattedValue.ToString(), out projectionsRowId);
int.TryParse(
inventoryDataGridView.Rows[currentRowIndex].Cells[(int) SalesTableColumns.Id]
.EditedFormattedValue.ToString(), out inventoryRowId);
int.TryParse(
actualSalesDataGridView.Rows[currentRowIndex].Cells[(int) SalesTableColumns.Id]
.EditedFormattedValue.ToString(), out actualSalesRowId);
if (dbWriter.DeleteApcRow(projectionsRowId, inventoryRowId, actualSalesRowId))
{
informationLabel.Text = @"Successfully removed row " + (currentRowIndex + 1) + @" from the database.";
informationLabel.Text = @"Successfully removed row " + (currentRowIndex + 1) +
@" from the database.";
}
else
{
//If the removing failed cancel the row deletion in the DataGridView.
e.Cancel = true;
MessageBox.Show(@"Failed to delete " + dataGridView.Rows[currentRowIndex].Cells[1].EditedFormattedValue +
MessageBox.Show(
@"Failed to delete " + dataGridView.Rows[currentRowIndex].Cells[1].EditedFormattedValue +
@" from the database.", @"Failed to Update Database");
return;
}
}
else
{
e.Cancel = true;
return;
}
}
//If the ad item entered in the first cell is in the gUsedAdItems collection, then remove it from there.
_usedAdItems[0].Remove(dataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.AdItem].EditedFormattedValue.ToString());
@@ -748,6 +754,11 @@ namespace AdvertsingProfitControl
return;
}
}
else
{
e.Cancel = true;
return;
}
}
//If the ad item entered in the first cell is in the gUsedAdItems collection, then remove it from there.
_usedAdItems[0].Remove(dataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.AdItem].EditedFormattedValue.ToString());
@@ -781,6 +792,11 @@ namespace AdvertsingProfitControl
return;
}
}
else
{
e.Cancel = true;
return;
}
}
//If the ad item entered in the first cell is in the gUsedAdItems collection, then remove it from there.
_usedAdItems[1].Remove(dataGridView.Rows[currentRowIndex].Cells[(int)SalesTableColumns.AdItem].EditedFormattedValue.ToString());
@@ -1031,7 +1047,8 @@ namespace AdvertsingProfitControl
//Clear the error text since there is in fact an item entered.
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = string.Empty;
//Send the ad item text through the formatting engine and assign the new value to the cell.
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = TextFormat.FormatAdItemText(userInput);
userInput = TextFormat.FormatAdItemText(userInput);
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = userInput;
var parser = new RowParsing();
if (parser.CheckForGroupKeyWord(userInput) == "NoGroupFound")
{
@@ -1078,9 +1095,24 @@ namespace AdvertsingProfitControl
e.Cancel = true;
return;
}
//Update the color coding of the other tables.
var helperClass = new AdvertisingProfitControlTableHelper();
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, projectionsDataGridView);
if (inventoryDataGridView.RowCount > e.RowIndex)
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.AdItem].Value = userInput;
}
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.AdItem].Value = userInput;
}
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, actualSalesDataGridView);
}
else
{
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
dataGridView.RefreshEdit();
e.Cancel = true;
return;
}
@@ -1559,7 +1591,7 @@ namespace AdvertsingProfitControl
else
{
//Check to see if the ad special index has changed.
if (e.RowIndex != _adSpecialIndex && _adSpecialIndex == -1)
if (_adSpecialIndex == -1)
{
//Check to see if there is an ID in the row and warn the user about the row deletion.
if (dataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.Id].EditedFormattedValue.ToString() != string.Empty)
@@ -1586,9 +1618,24 @@ namespace AdvertsingProfitControl
e.Cancel = true;
return;
}
//Update the color coding of the other tables.
var helperClass = new AdvertisingProfitControlTableHelper();
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, projectionsDataGridView);
if (inventoryDataGridView.RowCount > e.RowIndex)
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.AdItem].Value = userInput;
}
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.AdItem].Value = userInput;
}
helperClass.PaintRowGroupsFromIndex(e.RowIndex - 1, actualSalesDataGridView);
}
else
{
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
dataGridView.RefreshEdit();
e.Cancel = true;
return;
}
@@ -2832,6 +2879,7 @@ namespace AdvertsingProfitControl
for (var rowIndex = 0; rowIndex < projections.Rows.Count; rowIndex++)
{
var newRow = new DataGridViewRow();
var isMemberRow = false;
for (var cellIndex = 0; cellIndex < projections.Rows[rowIndex].ItemArray.Length; cellIndex++)
{
//ID and Ad Item.
@@ -2847,7 +2895,13 @@ namespace AdvertsingProfitControl
//Everything in between the ad item cell and the row attribute cells.
if (cellIndex > 1 && cellIndex <= 7)
{
if (projections.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0.0000")
//Only allow zeros in the Sold columns otherwise just leave them blank.
if (cellIndex == (int) SalesTableColumns.Sold)
{
var cell = new DataGridViewTextBoxCell { Value = projections.Rows[rowIndex].ItemArray[cellIndex].ToString() };
newRow.Cells.Add(cell);
}
else if (projections.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0.0000" || projections.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0")
{
var cell = new DataGridViewTextBoxCell {Value = string.Empty};
newRow.Cells.Add(cell);
@@ -2875,6 +2929,7 @@ namespace AdvertsingProfitControl
case 2:
//Member Row
isMemberCell.Value = true;
isMemberRow = true;
newRow.DefaultCellStyle.BackColor = ApplicationColors.MemberRow;
break;
default:
@@ -2913,6 +2968,15 @@ namespace AdvertsingProfitControl
_usedAdItems[0].Add(projections.Rows[rowIndex].ItemArray[1].ToString());
}
}
if (!isMemberRow) continue;
//Clear all values from the member row, they are not needed.
newRow.Cells[2].Value = string.Empty;
newRow.Cells[3].Value = string.Empty;
newRow.Cells[4].Value = string.Empty;
newRow.Cells[5].Value = string.Empty;
newRow.Cells[6].Value = string.Empty;
newRow.Cells[7].Value = string.Empty;
}
//Set the is dirty cell to false.
var isDirtyCell = new DataGridViewCheckBoxCell
@@ -2945,6 +3009,7 @@ namespace AdvertsingProfitControl
for (var rowIndex = 0; rowIndex < inventoryTable.Rows.Count; rowIndex++)
{
var newRow = new DataGridViewRow();
var isMemberRow = false;
for (var cellIndex = 0; cellIndex < inventoryTable.Rows[rowIndex].ItemArray.Length; cellIndex++)
{
//ID and Ad Item.
@@ -2960,16 +3025,8 @@ namespace AdvertsingProfitControl
//Everything in between the ad item cell and the row attribute cells.
if (cellIndex > 1 && cellIndex <= 5)
{
if (inventoryTable.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0")
{
var cell = new DataGridViewTextBoxCell {Value = string.Empty};
newRow.Cells.Add(cell);
}
else
{
var cell = new DataGridViewTextBoxCell {Value = inventoryTable.Rows[rowIndex].ItemArray[cellIndex].ToString()};
newRow.Cells.Add(cell);
}
var cell = new DataGridViewTextBoxCell {Value = inventoryTable.Rows[rowIndex].ItemArray[cellIndex].ToString()};
newRow.Cells.Add(cell);
continue;
}
//Check the attribute cell.
@@ -2988,6 +3045,7 @@ namespace AdvertsingProfitControl
case 2:
//Member Row
isMemberCell.Value = true;
isMemberRow = true;
newRow.DefaultCellStyle.BackColor = ApplicationColors.MemberRow;
break;
default:
@@ -3003,7 +3061,7 @@ namespace AdvertsingProfitControl
if (cellIndex == 7)
{
if (inventoryTable.Rows[rowIndex].ItemArray[cellIndex].ToString() != "0" && adSpecialIndex == -1)
{
{
var databaseTracker = new DatabaseTracker();
var databaseReader = new DatabaseReader();
var groupName = databaseReader.ReturnGroupNameFromGroupId(inventoryTable.Rows[rowIndex].ItemArray[cellIndex].ToString(), databaseTracker.DatabaseConnectionString);
@@ -3014,6 +3072,13 @@ namespace AdvertsingProfitControl
adSpecialIndex = rowIndex;
}
}
if (!isMemberRow) continue;
//Clear all values from the member row, they are not needed.
newRow.Cells[2].Value = string.Empty;
newRow.Cells[3].Value = string.Empty;
newRow.Cells[4].Value = string.Empty;
newRow.Cells[5].Value = string.Empty;
}
//Set the is dirty cell to false.
var isDirtyCell = new DataGridViewCheckBoxCell
@@ -3046,6 +3111,7 @@ namespace AdvertsingProfitControl
for (var rowIndex = 0; rowIndex < actualSales.Rows.Count; rowIndex++)
{
var newRow = new DataGridViewRow();
var isMemberRow = false;
for (var cellIndex = 0; cellIndex < actualSales.Rows[rowIndex].ItemArray.Length; cellIndex++)
{
//ID and Ad Item.
@@ -3061,9 +3127,15 @@ namespace AdvertsingProfitControl
//Everything in between the ad item cell and the row attribute cells.
if (cellIndex > 1 && cellIndex <= 7)
{
if (actualSales.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0.0000")
//Only allow zeros in the Sold columns otherwise just leave them blank.
if (cellIndex == (int)SalesTableColumns.Sold)
{
var cell = new DataGridViewTextBoxCell {Value = string.Empty};
var cell = new DataGridViewTextBoxCell { Value = actualSales.Rows[rowIndex].ItemArray[cellIndex].ToString() };
newRow.Cells.Add(cell);
}
else if (actualSales.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0.0000" || actualSales.Rows[rowIndex].ItemArray[cellIndex].ToString() == "0")
{
var cell = new DataGridViewTextBoxCell { Value = string.Empty };
newRow.Cells.Add(cell);
}
else
@@ -3089,6 +3161,7 @@ namespace AdvertsingProfitControl
case 2:
//Member Row
isMemberCell.Value = true;
isMemberRow = true;
newRow.DefaultCellStyle.BackColor = ApplicationColors.MemberRow;
break;
default:
@@ -3115,6 +3188,15 @@ namespace AdvertsingProfitControl
adSpecialIndex = rowIndex;
}
}
if (!isMemberRow) continue;
//Clear all values from the member row, they are not needed.
newRow.Cells[2].Value = string.Empty;
newRow.Cells[3].Value = string.Empty;
newRow.Cells[4].Value = string.Empty;
newRow.Cells[5].Value = string.Empty;
newRow.Cells[6].Value = string.Empty;
newRow.Cells[7].Value = string.Empty;
}
//Set the is dirty cell to false.
var isDirtyCell = new DataGridViewCheckBoxCell
@@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>ffANB5BH9jvoyfR09JBLV4mTjMowgtoLxga6w/HpWLU=</dsig:DigestValue>
<dsig:DigestValue>Cu5j9/buzIqFXwUVaREpWMereptetrOpSA4RfZP4zPs=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
@@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AdvertsingProfitControl.exe" size="3655168">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AdvertsingProfitControl.exe" size="2433536">
<assemblyIdentity name="AdvertsingProfitControl" version="1.9.2.0" language="neutral" processorArchitecture="amd64" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>X7+5y23vASKIWqD7axQzZHiWBiU+8VPagqUiqgXGMTw=</dsig:DigestValue>
<dsig:DigestValue>IfKNnpS3AvxJQzSAD+uL9oD6uCKebOR0f5N0pEztZ20=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
@@ -93,7 +93,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>APFHPCEQI/gZQZnqXRRCyHlaT6i2bDRte4X6ug1A8W8=</dsig:DigestValue>
<dsig:DigestValue>bPUdW2UkdkedvUlfZHuxhxUjqrn/LMCowSfDLWqF+4Y=</dsig:DigestValue>
</hash>
</file>
<file name="APCTemplate.accdb" size="819200">