Added a shrink changing form but the math seems to be off so it is disabled for the time being. Updated the interface on the main form and the modify record form to include the log viewer and the log console.
This commit is contained in:
@@ -3466,8 +3466,14 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
catch (DbUpdateException e)
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Projections: Row " + (lastRow + 1) + @".";
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
throw new TransactionAbortedException("Failed to update Projections." + Environment.NewLine + "Updates to Inventory aborted." + Environment.NewLine + "Updates to Actual Sales aborted." + Environment.NewLine);
|
||||
}
|
||||
}
|
||||
@@ -3601,8 +3607,14 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
catch (DbUpdateException e)
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Inventory: Row " + (lastRow + 1) + @".";
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
throw new TransactionAbortedException("Updates to Projections aborted." + Environment.NewLine + "Failed to update Inventory." + Environment.NewLine + "Updates to Actual Sales aborted." + Environment.NewLine);
|
||||
}
|
||||
}
|
||||
@@ -3774,8 +3786,14 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
catch (DbUpdateException e)
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Actual Sales: Row " + (lastRow + 1) + @".";
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
throw new TransactionAbortedException("Updates to Projections aborted." + Environment.NewLine +
|
||||
"Updates to Inventory aborted." + Environment.NewLine +
|
||||
"Failed to update Actual Sales" + Environment.NewLine);
|
||||
@@ -3886,9 +3904,15 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
catch (TransactionAbortedException e)
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Invoices: Row " + (lastRow + 1) + @".";
|
||||
informationLabel.Text += @"Failed to update Invoices." + Environment.NewLine;
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
//Check for the ID numbers to see what is in the database and what isn't.
|
||||
foreach (DataGridViewRow row in inventoryDataGridView.Rows)
|
||||
{
|
||||
@@ -3957,7 +3981,14 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Weekly Sales.";
|
||||
informationLabel.Text += @"Failed to update Weekly Sales." + Environment.NewLine;
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
//If the tag contains an object check to see if its in the database, if its not clear the tag out.
|
||||
if (isWeeklySalesDirtyCheckBox.Tag != null)
|
||||
{
|
||||
@@ -4025,7 +4056,14 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Taxable.";
|
||||
informationLabel.Text += @"Failed to update Taxable." + Environment.NewLine;
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
//If the tag contains an object check to see if its in the database, if its not clear the tag out.
|
||||
if (isTaxableDirtyCheckBox.Tag != null)
|
||||
{
|
||||
@@ -4085,7 +4123,14 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Cost Analysis.";
|
||||
informationLabel.Text += @"Failed to update Cost Analysis." + Environment.NewLine;
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
//If the tag contains an object check to see if its in the database, if its not clear the tag out.
|
||||
if (isCostAnalysisDirtyCheckBox.Tag != null)
|
||||
{
|
||||
@@ -4139,7 +4184,14 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
errorLabel.Text = @"Failed to update Comments.";
|
||||
informationLabel.Text += @"Failed to update Comments." + Environment.NewLine;
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.Message);
|
||||
if (e.InnerException.InnerException != null)
|
||||
{
|
||||
LogConsole.WriteToLog(FrmLogConsole.Level.Error, e.InnerException.InnerException.Message);
|
||||
}
|
||||
}
|
||||
//If the tag contains an object check to see if its in the database, if its not clear the tag out.
|
||||
if (isCommentDirtyCheckBox.Tag != null)
|
||||
{
|
||||
@@ -4469,5 +4521,23 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ViewLogFiles(object sender, EventArgs e)
|
||||
{
|
||||
var form = new FrmLogFileViewer();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
||||
private void DisplayLogConsole(object sender, EventArgs e)
|
||||
{
|
||||
if (LogConsole.IsVisable)
|
||||
{
|
||||
LogConsole.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogConsole.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user