public override void LoadData(DBConn dbConn) { dbConn.SourceInfo = "Stock.LoadData"; stockId = dbConn.ColLong("StockId", 0, 0); symbol = dbConn.ColString("Symbol"); exchangeCode = dbConn.ColString("BrokerExchangeCode", 0, 0); primaryExchange = dbConn.ColString("PrimaryExchange", 0, 0); securityType = dbConn.ColString("SecType", 0, 0); currencyCode = dbConn.ColString("CUR", 0, 0); resolution = dbConn.ColString("Resolution", 0, 0); theDate = dbConn.ColDate("Date", 0, 0); ticksMax = dbConn.ColLong("Ticks", 0, 0); ticksSkip = dbConn.ColLong("Skip", 0, 0); // UNIX timestamps, BigInt (64-bit) fromDate = dbConn.ColBig("FromDate", 0, 0); toDate = dbConn.ColBig("ToDate", 0, 0); // UNIX timestamps, Int (32-bit) // fromDate = dbConn.ColLong ("FromDate",0,0); // toDate = dbConn.ColLong ("ToDate",0,0); // Date format // fromDate = dbConn.ColDate ("FromDate",0,0); // toDate = dbConn.ColDate ("ToDate",0,0); price = 0; quantity = 0; tickType = 0; }
protected int LoadDataFromSQL(object[][] parms, int maxRows, System.Type classType = null, byte pagingMode = 0, string sourceInfo = "") { objList.Clear(); if (Tools.OpenDB(ref dbConn)) { int q = 0; dbConn.SourceInfo = sourceInfo; if (maxRows > short.MaxValue) { maxRows = short.MaxValue; } else if (maxRows < 1) { maxRows = Constants.MaxRowsSQL; } if (dbConn.Execute(sql, true, parms)) { if (pagingMode == (byte)PCIBusiness.Constants.PagingMode.AllowScreenPaging && !dbConn.EOF && dbConn.ColStatus("RowsPerPage") == Constants.DBColumnStatus.ColumnOK) { rowsTotal = dbConn.ColLong("RowsTotal"); rowsPerPage = dbConn.ColLong("RowsPerPage"); dbConn.NextResultSet(); } while (!dbConn.EOF && q < maxRows) { q++; if (classType == null) { objItem = NewItem(); } else { objItem = (PCIBusiness.BaseData)Activator.CreateInstance(classType); } objItem.RowNumber = q; objItem.LoadData(dbConn); objList.Add(objItem); if (pagingMode != (byte)PCIBusiness.Constants.PagingMode.DoNotReadNextRow) { dbConn.NextRow(); } } } } Tools.CloseDB(ref dbConn); return(objList.Count); }
// protected void ExecuteSQLDebug() // { // Tools.LogInfo("SQLDebug/1","SQL = "+sql); // if ( ExecuteSQL(null,false) == 0 ) // { // Tools.LogInfo("SQLDebug/2","Execution successful, column count = " + dbConn.ColumnCount.ToString()); // for ( int k = 0 ; k < dbConn.ColumnCount ; k++ ) // Tools.LogInfo("SQLDebug/3","(Col " + k.ToString() // + ") Name = " + dbConn.ColName(k) // + ", Type = " + dbConn.ColDataType(dbConn.ColName(k)) // + ", Value = " + dbConn.ColValue(k)); // } // else // Tools.LogInfo("SQLDebug/4","Execution failed, return code = " + returnCode.ToString()); // Tools.CloseDB(ref dbConn); // } protected int ExecuteSQLUpdate(bool closeConnection = true, bool getReturnCodes = true) { if (ExecuteSQL(null) == 0 && getReturnCodes) { returnCode = dbConn.ColLong("ReturnCode"); returnMessage = dbConn.ColString("ReturnMessage"); returnData = dbConn.ColString("ReturnData"); } if (closeConnection) { Tools.CloseDB(ref dbConn); } return(returnCode); }
public override void LoadData(DBConn dbConn) { // Payment Provider providerKey = dbConn.ColString("Safekey"); providerURL = dbConn.ColString("url"); providerAccount = dbConn.ColString("MerchantAccount", 0); providerUserID = dbConn.ColString("MerchantUserId", 0); providerPassword = dbConn.ColString("MerchantUserPassword", 0); // Customer if (dbConn.ColStatus("lastName") == Constants.DBColumnStatus.ColumnOK) { firstName = dbConn.ColUniCode("firstName"); lastName = dbConn.ColUniCode("lastName"); email = dbConn.ColString("email"); phoneCell = dbConn.ColString("mobile"); regionalId = dbConn.ColString("regionalId"); address1 = dbConn.ColString("address1"); address2 = dbConn.ColString("city"); postalCode = dbConn.ColString("zip_code"); provinceCode = dbConn.ColString("state"); countryCode = dbConn.ColString("countryCode"); ipAddress = dbConn.ColString("IPAddress"); } // Payment merchantReference = dbConn.ColString("merchantReference", 0); merchantReferenceOriginal = dbConn.ColString("merchantReferenceOriginal", 0); // Only really for Ikajo, don't log error paymentAmount = dbConn.ColLong("amountInCents", 0); currencyCode = dbConn.ColString("currencyCode", 0); paymentDescription = dbConn.ColString("description", 0); // Card/token/transaction details, not always present, don't log errors ccName = dbConn.ColString("nameOnCard", 0); ccNumber = dbConn.ColString("cardNumber", 0); ccExpiryMonth = dbConn.ColString("cardExpiryMonth", 0); ccExpiryYear = dbConn.ColString("cardExpiryYear", 0); ccType = dbConn.ColString("cardType", 0); ccCVV = dbConn.ColString("cvv", 0); ccToken = dbConn.ColString("token", 0); ccPIN = dbConn.ColString("PIN", 0); transactionID = dbConn.ColString("transactionId", 0); }
// protected void ExecuteSQLDebug() // { // Tools.LogInfo("SQLDebug/1","SQL = "+sql); // if ( ExecuteSQL(null,false) == 0 ) // { // Tools.LogInfo("SQLDebug/2","Execution successful, column count = " + dbConn.ColumnCount.ToString()); // for ( int k = 0 ; k < dbConn.ColumnCount ; k++ ) // Tools.LogInfo("SQLDebug/3","(Col " + k.ToString() // + ") Name = " + dbConn.ColName(k) // + ", Type = " + dbConn.ColDataType(dbConn.ColName(k)) // + ", Value = " + dbConn.ColValue(k)); // } // else // Tools.LogInfo("SQLDebug/4","Execution failed, return code = " + returnCode.ToString()); // Tools.CloseDB(ref dbConn); // } protected int ExecuteSQLUpdate(byte execMode = 1, bool closeConnection = true) { if (ExecuteSQL(null, execMode) == 0) { if (execMode == 1) { returnCode = dbConn.ColLong("ReturnCode"); returnMessage = dbConn.ColString("ReturnMessage", 0, 0); returnData = dbConn.ColString("ReturnData", 0, 0); } else if (execMode == 2) { returnCode = dbConn.ReturnValue; } } if (closeConnection) { Tools.CloseDB(ref dbConn); } return(returnCode); }