/*
         * create new user profile
         */
        public static ResultCodeType createNewProfile(paymentServer_dataBase DBHandler, UserProfile P)
        {
            if (DBHandler.Count("*", "userProfile WHERE email='" + P.email + "'") == 0)
            {
                string profile = "userProfile";
                string items = "(userNo, username, email, password, userType, firstName, lastName, middleName, DOBDay, DOBMonth, DOBYear, " +
                    "occupation, SIN, address1, address2, city, province, country, postalCode, phoneNumber, receiveCommunication, " +
                    "bankCode, accountNum, accountPWD, acctBalance, transactionHistory, POSHWID, currentDK, nextDK, authenticationString)";
                string values = "('" + P.userNo + "','" + P.username + "', '" + P.email + "', '" + P.password + "', '" + P.userType + "', '" + P.firstName + "', '" + P.lastName + "', '" +
                    P.middleName + "', '" + P.DOBDay + "', '" + P.DOBMonth + "', '" + P.DOBYear + "', '" + P.occupation + "', '" + P.SIN + "', '" + P.address1 + "', '" +
                    P.address2 + "', '" + P.city + "', '" + P.province + "', '" + P.country + "', '" + P.postalCode + "', '" + P.phoneNumber + "', '" + P.receiveCommunication + "', '" +
                    P.bankCode + "', '" + P.accountNum + "', '" + P.accountPWD + "', '" + P.acctBalance + "', '" + P.transactionHistory + "', '" + P.POSHWID + "', '" +
                    P.currentDK + "', '" + P.nextDK + "', '" + P.authenticationString + "')";

                DBHandler.Insert(profile, items, values);
                DBHandler.Insert("authenticationList", "(authenticationString)", "('"+P.authenticationString+"')");

                return ResultCodeType.RESULT_CREATE_PROFILE_SUCCESS;
            }

            else
            {
                return ResultCodeType.ERROR_CREATE_PROFILE_ACCOUNT_EXISTS;
            }
        }
        /*
         * Authenticate user
         */
        public static Boolean authenticateUser(paymentServer_dataBase DBHandler, string authenticationString)
        {
            int count = DBHandler.Count("*", "authenticationList WHERE authenticationString='"+authenticationString+"'");
            /*//JT:HACK Start
            if (count == 0)
            {
                DBHandler.Insert("authenticationList", "(authenticationString)", "('"+authenticationString+"')");
                Console.WriteLine("XXXX JT:HACK - ServerWorker::authenticateUser - Insertion successfull");
                Console.WriteLine("XXXX JT:HACK - ServerWorker::authenticateUser - User not authenticated but was added to database");
            }
            //JT:HACK End */

            if (DBHandler.Count("*", "authenticationList WHERE authenticationString='" + authenticationString + "'") == 1)
            {
                Console.WriteLine("ServerWorker::authenticateUser - User authenticated with {0}", authenticationString);
                DBHandler.Backup();
                return true;
            }
            Console.WriteLine("ServerWorker::authenticateUser - Could not authenticate user. DB Query returned count of {0}", count);
            return false;
        }