public string showCalorieCounterSummary(int numberOfRecords, double totalNetCalories, double totalConsumedCalories)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (numberOfRecords > 0)
            {
                output += "<div style='width: 100%'>\n";
                output += "<label>You consumed a total of " + importTextFormatter.chopText(totalConsumedCalories.ToString("N2"), 40) + " calories.</label>\n";
                output += "</div>\n";
                output += "<div style='width: 100%'>\n";

                if (totalNetCalories > 0)
                {
                    output += "<label>Based on your total calorie intake and exercise activities factored in, you have achieved a net gain of " + importTextFormatter.chopText(totalNetCalories.ToString("N2"), 40) + " calories.</label>\n";
                }
                else if (totalNetCalories == 0)
                {
                    output += "<label>Based on your total calorie intake and exercise activities factored in, you have not achieved a net gain or net loss of calories.</label>\n";
                } else if (totalNetCalories < 0)
                {
                    output += "<label>Based on your total calorie intake and exercise activities factored in, you have achieved a net loss of " + importTextFormatter.chopText(totalNetCalories.ToString("N2").TrimStart('-'), 40) + " calories.</label>\n";
                }

                output += "</div>\n";
                output += "<div style='width: 100%'>\n";
                output += "<label><b>Notice: The statement (above) is just based on the system's assumptions that you provided and retained all of the correct information.  However, the time of day that your calories were consumed, are not factored in.</b></label>\n";
                output += "</div>\n";
            }

            return output;
        }
Esempio n. 2
0
        public string convertFromRawMinutes(int rawMinutesForEachActivity)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            int leftOverMinutesForEachActivity = rawMinutesForEachActivity % 60;
            int hoursForEachActivity = (rawMinutesForEachActivity - leftOverMinutesForEachActivity) / 60;
            int leftOverHoursForEachActivity = hoursForEachActivity % 24;
            int daysForEachActivity = (hoursForEachActivity - leftOverHoursForEachActivity) / 24;

            if (daysForEachActivity == 1)
            {
                output += daysForEachActivity.ToString() + " day, ";
            }
            else
            {
                output += importTextFormatter.chopText(daysForEachActivity.ToString(), 40) + " days, ";
            }

            if (leftOverHoursForEachActivity == 1)
            {
                output += leftOverHoursForEachActivity.ToString() + " hour, and ";
            }
            else
            {
                output += leftOverHoursForEachActivity.ToString() + " hours, and ";
            }

            if (leftOverMinutesForEachActivity == 1)
            {
                output += leftOverMinutesForEachActivity.ToString() + " minute";
            }
            else
            {
                output += leftOverMinutesForEachActivity.ToString() + " minutes";
            }

            return output;
        }
        protected string searchDisplayName(string usernameValue)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            using (SqlConnection connection = new SqlConnection())
            {
                connection.ConnectionString = "connectionString";

                try
                {
                    connection.Open();

                    if (this.searchNumberOfRecords(usernameValue) == 1)
                    {
                        SqlCommand findAccounts = new SqlCommand("SELECT * FROM users WHERE username LIKE @prepareUsername", connection);

                        findAccounts.Parameters.AddWithValue("@prepareUsername", usernameValue);

                        using (SqlDataReader extractSearchResults = findAccounts.ExecuteReader())
                        {
                            while (extractSearchResults.Read())
                            {
                                output += importTextFormatter.chopText(extractSearchResults.GetString(2), 40);
                            }
                        }
                    }
                    else
                    {
                        output += "username not found";
                    }

                    connection.Close();
                }
                catch (Exception)
                {
                    output += "query exception";
                }
            }

            return output;
        }
        //This method searches a user's security questions.
        protected string mySecurityQuestions(string usernameValue, string selectSecurityQuestion, string deleteSelected)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (this.searchNumberOfRecords(usernameValue, "") > 0)
            {
                output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                using (SqlConnection connection = new SqlConnection())
                {
                    connection.ConnectionString = "connectionString";

                    try
                    {
                        connection.Open();

                        SqlCommand searchUserSecurityQuestions = new SqlCommand("SELECT * FROM securityQuestions WHERE username LIKE @prepareUsername ORDER BY recorded DESC", connection);

                        searchUserSecurityQuestions.Parameters.AddWithValue("@prepareUsername", usernameValue);

                        using (SqlDataReader extractUserSecurityQuestions = searchUserSecurityQuestions.ExecuteReader())
                        {
                            if (deleteSelected == "Delete selected")
                            {
                                if (usernameValue != "" && usernameValue != "cookie exception")
                                {
                                    if (this.deleteSecurityQuestions(selectSecurityQuestion) != "query exception")
                                    {
                                        output += "<div style='width: 100%'><br />" + this.deleteSecurityQuestions(selectSecurityQuestion) + "</div>\n";
                                    }
                                    else
                                    {
                                        output += "<div style='width: 100%'><br /><label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/manage-security-questions.aspx'>here</a> to refresh.</label></div>\n";
                                    }
                                }
                            }

                            while (extractUserSecurityQuestions.Read())
                            {
                                output += "<div style='width: 100%'><br /><input class='selectSecurityQuestion' name='selectSecurityQuestion' type='checkbox' value='" + extractUserSecurityQuestions.GetString(0) + "' /></div>\n";
                                output += "<div style='width: 100%'><label><b>Question:</b> " + importTextFormatter.chopText(extractUserSecurityQuestions.GetString(2), 40) + "</label></div>\n";
                                output += "<div style='width: 100%'><label><b>Answer:</b> " + importTextFormatter.chopText(extractUserSecurityQuestions.GetString(3), 40) + "</label></div>\n";
                            }
                        }

                        connection.Close();
                    }
                    catch (Exception)
                    {
                        output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/manage-security-questions.aspx'>here</a> to refresh.</label>\n";
                    }
                }
            }
            else
            {
                output += "<label>You do not have any security questions.  It would be a good idea to add some questions, in case you get locked out of your account!</label>\n";
            }

            return output;
        }
Esempio n. 5
0
        private string renderNotesLimitedView(string argument2, string argument3, string argument4, string argument5)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (argument2.Length > 40)
            {
                output += "<div style='width: 100%'><label><b>" + importTextFormatter.chopText(argument2.Substring(0, 40), 40) + "...</b></label></div>\n";
            }
            else
            {
                output += "<div style='width: 100%'><label><b>" + importTextFormatter.chopText(argument2, 40) + "</b></label></div>\n";
            }

            if (argument3.Length > 40)
            {
                output += "<div style='width: 100%'><label>" + importTextFormatter.chopText(argument3.Substring(0, 40), 40) + "...</label></div>\n";
            }
            else
            {
                output += "<div style='width: 100%'><label>" + importTextFormatter.chopText(argument3, 40) + "</label></div>\n";
            }

            output += "<div style='width: 100%'><label>Date created: <i>" + argument4 + "</i></label></div>\n";

            if (!(String.IsNullOrWhiteSpace(argument5)))
            {
                output += "<div style='width: 100%'><label>Date updated: <i>" + argument5 + "</i></label></div>\n";
            }

            return output;
        }
Esempio n. 6
0
        protected string searchFocusedNote(string usernameValue, string requestId)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            using (SqlConnection connection = new SqlConnection())
            {
                connection.ConnectionString = "connectionString";

                try
                {
                    connection.Open();

                    SqlCommand findRecords = new SqlCommand("SELECT * FROM notes where username LIKE @prepareUsername AND note_id LIKE @prepareNoteId", connection);

                    findRecords.Parameters.AddWithValue("@prepareUsername", usernameValue);
                    findRecords.Parameters.AddWithValue("@prepareNoteId", requestId);

                    using (SqlDataReader extractSearchResults = findRecords.ExecuteReader())
                    {
                        while (extractSearchResults.Read())
                        {
                            output += "<div style='width: 100%'><label><b>" + importTextFormatter.chopText(extractSearchResults.GetString(2), 40) + "</b></label></div>\n";
                            output += "<div style='width: 100%'><label>" + importTextFormatter.chopText(extractSearchResults.GetString(3), 40) + "</label></div>\n";
                            output += "<div style='width: 100%'><label>Date created: <i>" + extractSearchResults.GetString(4) + "</i></label></div>\n";

                            if (!(String.IsNullOrWhiteSpace(extractSearchResults.GetString(5))))
                            {
                                output += "<div style='width: 100%'><label>Date updated: <i>" + extractSearchResults.GetString(5) + "</i></label></div>\n";
                            }
                        }
                    }

                    connection.Close();
                }
                catch (Exception)
                {
                    output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/'>here</a> to refresh.</label>\n";
                }
            }

            return output;
        }
Esempio n. 7
0
        protected string searchAllNotes(string usernameValue, string searchBy, string orderBy, string searchValue, string searchNotes, string selectNote, string deleteSelected)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (deleteSelected == "Delete selected")
            {
                if (usernameValue != "" && usernameValue != "cookie exception")
                {
                    if (this.deleteNotes(selectNote) != "query exception")
                    {
                        output += "<div style='width: 100%'><br />" + this.deleteNotes(selectNote) + "</div>\n";
                    }
                    else
                    {
                        output += "<div style='width: 100%'><br /><label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/'>here</a> to refresh.</label><br /><br /></div>\n";
                    }
                }
            }

            using (SqlConnection connection = new SqlConnection())
            {
                connection.ConnectionString = "connectionString";

                try
                {
                    connection.Open();

                    if (this.searchNumberOfRecords(usernameValue) > 0)
                    {
                        if (searchNotes == "Search notes")
                        {
                            if (this.searchNumberOfRecords(usernameValue, searchBy, searchValue) > 0)
                            {
                                string searchString = this.searchContentByCriteria(searchBy, orderBy);

                                SqlCommand findRecords = new SqlCommand(searchString, connection);

                                findRecords.Parameters.AddWithValue("@prepareUsername", usernameValue);
                                findRecords.Parameters.AddWithValue("@prepareSearchValue", "%" + searchValue + "%");

                                using (SqlDataReader extractSearchResults = findRecords.ExecuteReader())
                                {
                                    output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                                    while (extractSearchResults.Read())
                                    {
                                        output += "<div style='width: 100%'><br /><input class='selectNote' name='selectNote' type='checkbox' value='" + extractSearchResults.GetString(0) + "' /></div>\n";
                                        output += this.renderNotesLimitedView(extractSearchResults.GetString(2), extractSearchResults.GetString(3), extractSearchResults.GetString(4), extractSearchResults.GetString(5));
                                        output += "<div style='width: 100%'><label><a id='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/default.aspx?id=" + extractSearchResults.GetString(0) + "'>View/edit note</a></label></div>\n";
                                    }
                                }
                            }
                            else
                            {
                                output += "<div style='width: 100%'><label>Sorry, there is no match for \"" + importTextFormatter.chopText(searchValue, 40) + "\"! Please <a id='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/'>try again</a>.</label></div>\n";
                            }
                        }
                        else
                        {
                            SqlCommand findRecords = new SqlCommand("SELECT * FROM notes where username LIKE @prepareUsername ORDER BY recorded DESC", connection);

                            findRecords.Parameters.AddWithValue("@prepareUsername", usernameValue);

                            using (SqlDataReader extractSearchResults = findRecords.ExecuteReader())
                            {
                                output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                                while (extractSearchResults.Read())
                                {
                                    output += "<div style='width: 100%'><br /><input class='selectNote' name='selectNote' type='checkbox' value='" + extractSearchResults.GetString(0) + "' /></div>\n";
                                    output += this.renderNotesLimitedView(extractSearchResults.GetString(2), extractSearchResults.GetString(3), extractSearchResults.GetString(4), extractSearchResults.GetString(5));
                                    output += "<div style='width: 100%'><label><a id='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/default.aspx?id=" + extractSearchResults.GetString(0) + "'>View/edit note</a></label></div>\n";
                                }
                            }
                        }
                    }
                    else
                    {
                        output += "<div style='width: 100%'><label>You are not storing any notes.  Let's get started!</label></div>\n";
                    }

                    connection.Close();
                }
                catch (Exception)
                {
                    output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/note-taker/'>here</a> to refresh.</label>\n";
                }
            }

            return output;
        }
Esempio n. 8
0
        protected string savedActivitiesLog(string usernameValue, string selectSavedActivities, string deleteSelected)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();
            Utilities.MathConverters importMathConverters = new Utilities.MathConverters();

            string output = "";

            if (this.searchNumberOfRecords(usernameValue, "completely saved") > 0)
            {
                output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                using (SqlConnection connection = new SqlConnection())
                {
                    connection.ConnectionString = "connectionString";

                    try
                    {
                        connection.Open();

                        SqlCommand searchSavedActivitiesLog = new SqlCommand("SELECT * FROM savedActivities WHERE username LIKE @prepareUsername ORDER BY recorded DESC", connection);

                        searchSavedActivitiesLog.Parameters.AddWithValue("@prepareUsername", usernameValue);

                        using (SqlDataReader extractSavedActivitiesLog = searchSavedActivitiesLog.ExecuteReader())
                        {
                            if (deleteSelected == "Delete selected")
                            {
                                if (usernameValue != "" && usernameValue != "cookie exception")
                                {
                                    if (this.deleteSavedActivities(selectSavedActivities) != "query exception")
                                    {
                                        output += "<div style='width: 100%'><br />" + this.deleteSavedActivities(selectSavedActivities) + "</div>\n";
                                    }
                                    else
                                    {
                                        output += "<div style='width: 100%'><br /><label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/stop-watch/'>here</a> to refresh.</label></div>\n";
                                    }
                                }
                            }

                            while (extractSavedActivitiesLog.Read())
                            {
                                if (!(String.IsNullOrWhiteSpace(extractSavedActivitiesLog.GetString(4))) && !(String.IsNullOrWhiteSpace(extractSavedActivitiesLog.GetString(5))) && !(String.IsNullOrWhiteSpace(extractSavedActivitiesLog.GetString(6))) && !(String.IsNullOrWhiteSpace(extractSavedActivitiesLog.GetString(7))) && extractSavedActivitiesLog.GetString(8) == "yes")
                                {
                                    try
                                    {
                                        int intRawStartingTime = Convert.ToInt32(extractSavedActivitiesLog.GetString(4));
                                        int intRawEndingTime = Convert.ToInt32(extractSavedActivitiesLog.GetString(5));

                                        int intTotalMinutesForActivity = intRawEndingTime - intRawStartingTime;

                                        output += "<div style='width: 100%'><br /><br /><input class='selectSavedActivities' name='selectSavedActivities' type='checkbox' value='" + extractSavedActivitiesLog.GetString(0) + "' /></div>\n";
                                        output += "<div style='width: 100%'>\n";
                                        output += "<label><b>Activity name:</b> " + importTextFormatter.chopText(extractSavedActivitiesLog.GetString(2), 40) + "</label>\n";
                                        output += "</div>\n";
                                        output += "<div style='width: 100%'>\n";
                                        output += "<label>Started on " + extractSavedActivitiesLog.GetString(6) + "</label>\n";
                                        output += "</div>\n";
                                        output += "<div style='width: 100%'>\n";
                                        output += "<label>Completed on " + extractSavedActivitiesLog.GetString(7) + "</label>\n";
                                        output += "</div>\n";
                                        output += "<div style='width: 100%'>\n";
                                        output += "<label><i>You spent " + importMathConverters.convertFromRawMinutes(intTotalMinutesForActivity) + " on this activity.</i></label>\n";
                                        output += "</div>\n";
                                        output += "<div style='width: 100%'>\n";

                                        if (String.IsNullOrWhiteSpace(extractSavedActivitiesLog.GetString(3)) || extractSavedActivitiesLog.GetString(3) == "no value")
                                        {
                                            output += "<label><b>Description:</b> You do not have any details for this activity.</label>\n";
                                        }
                                        else
                                        {
                                            output += "<label><b>Description:</b> " + importTextFormatter.chopText(extractSavedActivitiesLog.GetString(3), 40) + "</label>\n";
                                        }

                                        output += "</div>\n";
                                    }
                                    catch (Exception)
                                    {
                                        output += "";
                                    }
                                }
                            }
                        }

                        connection.Close();
                    }
                    catch (Exception)
                    {
                        output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/stop-watch/'>here</a> to refresh.</label>\n";
                    }
                }
            }
            else
            {
                output += "<label>Your activity history is empty.</label>\n";
            }

            return output;
        }
        protected string foodItemsOrExerciseActivitiesLog(string usernameValue, string selectFoodItemsOrExerciseActivities, string deleteSelected)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (this.searchNumberOfRecords(usernameValue) > 0)
            {
                output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                using (SqlConnection connection = new SqlConnection())
                {
                    connection.ConnectionString = "connectionString";

                    try
                    {
                        connection.Open();

                        SqlCommand searchFoodItemsOrExerciseActivitiesLog = new SqlCommand("SELECT * FROM calorieCounter WHERE username LIKE @prepareUsername ORDER BY recorded DESC", connection);

                        searchFoodItemsOrExerciseActivitiesLog.Parameters.AddWithValue("@prepareUsername", usernameValue);

                        using (SqlDataReader extractFoodItemsOrExerciseActivitiesLog = searchFoodItemsOrExerciseActivitiesLog.ExecuteReader())
                        {
                            if (deleteSelected == "Delete selected")
                            {
                                if (usernameValue != "" && usernameValue != "cookie exception")
                                {
                                    if (this.deleteFoodItemsOrExerciseActivities(selectFoodItemsOrExerciseActivities) != "query exception")
                                    {
                                        output += "<div style='width: 100%'><br />" + this.deleteFoodItemsOrExerciseActivities(selectFoodItemsOrExerciseActivities) + "</div>\n";
                                    }
                                    else
                                    {
                                        output += "<div style='width: 100%'><br /><label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/calorie-counter/'>here</a> to refresh.</label></div>\n";
                                    }
                                }
                            }

                            while (extractFoodItemsOrExerciseActivitiesLog.Read())
                            {
                                output += "<div style='width: 100%'><br /><br /><input class='selectFoodItemsOrExerciseActivities' name='selectFoodItemsOrExerciseActivities' type='checkbox' value='" + extractFoodItemsOrExerciseActivitiesLog.GetString(0) + "' /></div>\n";

                                if (extractFoodItemsOrExerciseActivitiesLog.GetString(6) == "food or beverage item")
                                {
                                    double decimalNumberOfCaloriesPerServing = (double)extractFoodItemsOrExerciseActivitiesLog.GetDecimal(3);
                                    double decimalNumberOfServings = (double)extractFoodItemsOrExerciseActivitiesLog.GetDecimal(4);
                                    double decimalTotalNumberOfCalories = decimalNumberOfCaloriesPerServing * decimalNumberOfServings;

                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Food or drink item: " + importTextFormatter.chopText(extractFoodItemsOrExerciseActivitiesLog.GetString(2), 40) + "</label>\n";
                                    output += "</div>\n";
                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Calories per serving: " + importTextFormatter.chopText(decimalNumberOfCaloriesPerServing.ToString("N2"), 40) + "</label>\n";
                                    output += "</div>\n";
                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Number of servings: " + importTextFormatter.chopText(decimalNumberOfServings.ToString("N2"), 40) + "</label>\n";
                                    output += "</div>\n";
                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Total calories consumed for this item: " + importTextFormatter.chopText(decimalTotalNumberOfCalories.ToString("N2"), 40) + "</label>\n";
                                    output += "</div>\n";
                                }
                                else
                                {
                                    double decimalTotalCaloriesBurned = (double)extractFoodItemsOrExerciseActivitiesLog.GetDecimal(5);

                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Exercise activity: " + importTextFormatter.chopText(extractFoodItemsOrExerciseActivitiesLog.GetString(2), 40) + "</label>\n";
                                    output += "</div>\n";
                                    output += "<div style='width: 100%'>\n";
                                    output += "<label>Total calories burned for this activity: " + importTextFormatter.chopText(decimalTotalCaloriesBurned.ToString("N2"), 40) + "</label>\n";
                                    output += "</div>\n";
                                }
                            }
                        }

                        connection.Close();
                    }
                    catch (Exception)
                    {
                        output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/calorie-counter/'>here</a> to refresh.</label>\n";
                    }
                }
            }
            else
            {
                output += "<label>You are currently not monitoring any calorie intake or exercise activities.</label>\n";
            }

            return output;
        }
        public string showMyTransactionSummary(double netBalance, double totalIncome, double totalSpending, double averageIncome, double averageSpending)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            output += "<div style='width: 100%'>\n";

            if (netBalance < 0)
            {
                output += "<label><b>Net balance: <span style='color: #C00000'>- $" + importTextFormatter.chopText(netBalance.ToString("N2").TrimStart('-'), 40) + "</span></b></label>\n";
            }
            else
            {
                output += "<label><b>Net balance: $" + importTextFormatter.chopText(netBalance.ToString("N2"), 40) + "</b></label>\n";
            }

            output += "</div>\n";
            output += "<div style='width: 100%'>\n";

            if (totalIncome < 0)
            {
                output += "<label><b>Total income: <span style='color: #C00000'>- $" + importTextFormatter.chopText(totalIncome.ToString("N2").TrimStart('-'), 40) + "</span></b></label>\n";
            }
            else
            {
                output += "<label><b>Total income: $" + importTextFormatter.chopText(totalIncome.ToString("N2"), 40) + "</b></label>\n";
            }

            output += "</div>\n";
            output += "<div style='width: 100%'>\n";

            if (totalSpending < 0)
            {
                output += "<label><b>Total spending: <span style='color: #C00000'>- $" + importTextFormatter.chopText(totalSpending.ToString("N2").TrimStart('-'), 40) + "</span></b></label>\n";
            }
            else
            {
                output += "<label><b>Total spending: $" + importTextFormatter.chopText(totalSpending.ToString("N2"), 40) + "</b></label>\n";
            }

            output += "</div>\n";
            output += "<div style='width: 100%'>\n";

            if (averageIncome < 0)
            {
                output += "<label><b>Average income: <span style='color: #C00000'>- $" + importTextFormatter.chopText(averageIncome.ToString("N2").TrimStart('-'), 40) + "</span></b></label>\n";
            }
            else
            {
                output += "<label><b>Average income: $" + importTextFormatter.chopText(averageIncome.ToString("N2"), 40) + "</b></label>\n";
            }

            output += "</div>\n";
            output += "<div style='width: 100%'>\n";

            if (averageSpending < 0)
            {
                output += "<label><b>Average spending: <span style='color: #C00000'>- $" + importTextFormatter.chopText(averageSpending.ToString("N2").TrimStart('-'), 40) + "</span></b></label>\n";
            }
            else
            {
                output += "<label><b>Average spending: $" + importTextFormatter.chopText(averageSpending.ToString("N2"), 40) + "</b></label>\n";
            }

            output += "</div>\n";

            return output;
        }
        protected string transactionLog(string usernameValue, string selectTransactions, string deleteSelected)
        {
            Utilities.TextFormatter importTextFormatter = new Utilities.TextFormatter();

            string output = "";

            if (this.searchNumberOfRecords(usernameValue) > 0)
            {
                output += "<div style='width: 100%'><input id='deleteSelected' name='deleteSelected' type='submit' value='Delete selected' /></div>\n";

                using (SqlConnection connection = new SqlConnection())
                {
                    connection.ConnectionString = "connectionString";

                    try
                    {
                        connection.Open();

                        SqlCommand searchTransactionLog = new SqlCommand("SELECT * FROM transactionLog WHERE username LIKE @prepareUsername ORDER BY recorded DESC", connection);

                        searchTransactionLog.Parameters.AddWithValue("@prepareUsername", usernameValue);

                        using (SqlDataReader extractTransactionLog = searchTransactionLog.ExecuteReader())
                        {
                            if (deleteSelected == "Delete selected")
                            {
                                if (usernameValue != "" && usernameValue != "cookie exception")
                                {
                                    if (this.deleteTransactions(selectTransactions) != "query exception")
                                    {
                                        output += "<div style='width: 100%'><br />" + this.deleteTransactions(selectTransactions) + "</div>\n";
                                    }
                                    else
                                    {
                                        output += "<div style='width: 100%'><br /><label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/transaction-monitor/'>here</a> to refresh.</label></div>\n";
                                    }
                                }
                            }

                            while (extractTransactionLog.Read())
                            {
                                output += "<div style='width: 100%'><br /><input class='selectTransaction' name='selectTransaction' type='checkbox' value='" + extractTransactionLog.GetString(0) + "' /></div>\n";
                                output += "<div style='width: 100%'><label><b>Name:</b> " + importTextFormatter.chopText(extractTransactionLog.GetString(2), 40) + "</label></div>\n";

                                if (extractTransactionLog.GetString(3) != "no value")
                                {
                                    output += "<div style='width: 100%'><label><b>Description:</b> " + importTextFormatter.chopText(extractTransactionLog.GetString(3), 40) + "</label></div>\n";
                                }
                                else
                                {
                                    output += "<div style='width: 100%'><label><b>Description:</b> You do not have one.</label></div>\n";
                                }

                                double decimalTransactionAmount = (double)extractTransactionLog.GetDecimal(4);

                                output += "<div style='width: 100%'><label><b>Type:</b> " + importTextFormatter.chopText(extractTransactionLog.GetString(5), 40) + "</label></div>\n";
                                output += "<div style='width: 100%'><label><b>Amount: </b> $" + importTextFormatter.chopText(decimalTransactionAmount.ToString("N2"), 40) + "</label></div>\n";
                            }
                        }

                        connection.Close();
                    }
                    catch (Exception)
                    {
                        output += "<label>The website had a hiccup. Click <a class='textLink' href='http://www.timothysdigitalsolutions.somee.com/transaction-monitor/'>here</a> to refresh.</label>\n";
                    }
                }
            }
            else
            {
                output += "<label>You are not storing any transactions.</label>\n";
            }

            return output;
        }