Cleaned up the code in the new modify record form and changed the return value from string to integer in the date ID get method. Fixed a crash bug in the new add record form and fixed the row number bug in both forms.
This commit is contained in:
@@ -1195,7 +1195,7 @@ namespace AdvertsingProfitControl
|
||||
var databaseWriter = new DatabaseWriter(databaseTracker.DatabaseConnectionString);
|
||||
if (weekEndingDateMaskedTextBox.MaskCompleted)
|
||||
{
|
||||
if (databaseReader.RetrieveDateIdByDateString(weekEndingDateMaskedTextBox.Text, databaseTracker.DatabaseConnectionString) == "0")
|
||||
if (databaseReader.RetrieveDateIdByDateString(weekEndingDateMaskedTextBox.Text, databaseTracker.DatabaseConnectionString) == 0)
|
||||
{
|
||||
//Assume the date is correct and add it to the database.
|
||||
//TODO: Check the date vs the last date entered (obtained by sorting dates) and check to see if the two are seven (7) or more days apart.
|
||||
@@ -1217,12 +1217,12 @@ namespace AdvertsingProfitControl
|
||||
var commentsText = commentsTextBox.Text;
|
||||
if (Regex.Replace(commentsText, @"\s+", "") != "")
|
||||
{
|
||||
databaseWriter.RedundantlessInsertIntoComments(commentsTextBox.Text, dateIdString);
|
||||
databaseWriter.RedundantlessInsertIntoComments(commentsTextBox.Text, dateIdString.ToString());
|
||||
}
|
||||
|
||||
//Send the table's data to their respective functions.
|
||||
_gLogConsole.WriteToLog(FrmLogConsole.Level.Info, "Added the following rows to the APC table:");
|
||||
var rowsEffected = BuildAPCAndSendToDatabase(dateIdString);
|
||||
var rowsEffected = BuildAPCAndSendToDatabase(dateIdString.ToString());
|
||||
foreach (var i in rowsEffected)
|
||||
{
|
||||
_gLogConsole.WriteToLog(FrmLogConsole.Level.Info, (i + 1).ToString());
|
||||
|
||||
Reference in New Issue
Block a user