Marked as 'AdvertsingProfitControl (New Add Form)' by its folder name. I think this was one of the first appearences of a modify record form, however I may have gotten the order mixed up here with the previous commit. Reguardless, this version still introduced the first appearence of a new 'Modify Record' form.

This commit is contained in:
2021-01-28 20:02:35 -06:00
parent 21eaae4d67
commit 676a9dd890
24 changed files with 7495 additions and 491 deletions
+13 -31
View File
@@ -6,7 +6,6 @@ using System.Drawing.Printing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
@@ -27,8 +26,8 @@ namespace AdvertsingProfitControl
InitializeComponent();
//Set the maximum and minimum sizes for the form.
MaximumSize = new Size(1200, 650);
MinimumSize = new Size(1000, 550);
//MaximumSize = new Size(1200, 650);
//MinimumSize = new Size(1000, 550);
}
private void frmMain_Load(object sender, EventArgs e)
@@ -51,10 +50,19 @@ namespace AdvertsingProfitControl
BuildAndFillDataGridTables();
CalculateProfitAnalysis();
CalculateGrossProfit();
projectedSalesMainDataGrid.KeyDown += FrmMain_KeyDown;
//var margin = new Margins(50, 50, 0, 0);
//_printDoc.DefaultPageSettings.Margins = margin;
}
private void FrmMain_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.Up)
{
MessageBox.Show("My message");
}
}
private void UpdateDataGridViewInformation(object sender, EventArgs e)
{
var dateString = monthComboBox.Text + "/" + dayComboBox.Text + "/" + yearComboBox.Text;
@@ -220,7 +228,7 @@ namespace AdvertsingProfitControl
{
dataGridViewColumn.Visible = false;
}
dataGridViewColumn.HeaderText = AddSpacesToSentence(dataGridViewColumn.HeaderText, false);
dataGridViewColumn.HeaderText = TextFormat.AddSpacesToSentence(dataGridViewColumn.HeaderText, false);
dataGridView.Columns.Add(dataGridViewColumn);
}
@@ -307,7 +315,7 @@ namespace AdvertsingProfitControl
CellTemplate = new DataGridViewTextBoxCell()
};
var columnHeaderText = table.Columns[columnIndex].ColumnName;
columnHeaderText = AddSpacesToSentence(columnHeaderText, false);
columnHeaderText = TextFormat.AddSpacesToSentence(columnHeaderText, false);
//Make the row attribute column invisible.
if (table.Columns[columnIndex].ColumnName == "RowAttribute")
{
@@ -667,32 +675,6 @@ namespace AdvertsingProfitControl
adItemManager.ShowDialog();
}
//http://stackoverflow.com/questions/272633/add-spaces-before-capital-letters
/// <summary>
/// Add spaces between all words that have capital letters
/// allowing for pretty looking column header text.
/// </summary>
/// <param name="text">The column header text to be made presentable.</param>
/// <param name="preserveAcronyms">Whether or not to do anything with text that's in all caps.</param>
/// <returns></returns>
private string AddSpacesToSentence(string text, bool preserveAcronyms)
{
if (string.IsNullOrWhiteSpace(text))
return string.Empty;
var newText = new StringBuilder(text.Length * 2);
newText.Append(text[0]);
for (var i = 1; i < text.Length; i++)
{
if (char.IsUpper(text[i]))
if ((text[i - 1] != ' ' && !char.IsUpper(text[i - 1])) ||
(preserveAcronyms && char.IsUpper(text[i - 1]) &&
i < text.Length - 1 && !char.IsUpper(text[i + 1])))
newText.Append(' ');
newText.Append(text[i]);
}
return newText.ToString();
}
private void dbVersionHelpMainMenu_Click(object sender, EventArgs e)
{
var databaseTracker = new DatabaseTracker();