本文整理汇总了C#中databases类的典型用法代码示例。如果您正苦于以下问题:C# databases类的具体用法?C# databases怎么用?C# databases使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
databases类属于命名空间,在下文中一共展示了databases类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ImportICB_AddToDb
//Add to database
private void ImportICB_AddToDb(databases.importDS.icbCodeDataTable tbl, string fldName, bool haveDefitionFld,
databases.baseDS.sysCodeDataTable sysCodeTbl,string category,string codeGroupFldName)
{
databases.baseDS.sysCodeRow sysCodeRow;
common.myKeyValueItem item;
for (int idx = 0; idx < tbl.Count; idx++)
{
if (tbl[idx].RowState == DataRowState.Deleted) continue;
item = Imports.Libs.SplitKeyValue(tbl[idx][fldName].ToString(), " ");
if (item == null)
{
common.SysLog.WriteLog(tbl[idx][fldName].ToString() + " not found.");
continue;
}
if (sysCodeTbl.FindBycategorycode(category, item.Key) == null)
{
sysCodeRow = sysCodeTbl.NewsysCodeRow();
databases.AppLibs.InitData(sysCodeRow);
sysCodeRow.category = category;
sysCodeRow.code = item.Key;
sysCodeRow.description1 = item.Value;
sysCodeRow.tag1 = fldName;
if (codeGroupFldName != null) sysCodeRow.inGroup = tbl[idx][codeGroupFldName].ToString();
if (haveDefitionFld && !tbl[idx].IsdefinitionNull()) sysCodeRow.notes = tbl[idx].definition;
sysCodeTbl.AddsysCodeRow(sysCodeRow);
}
tbl[idx][fldName] = item.Key;
}
}
开发者ID:oghenez,项目名称:trade-software,代码行数:30,代码来源:importIcbCode.cs
示例2: LoadInvestor
public static void LoadInvestor(databases.tmpDS.investorDataTable tbl, bool force)
{
if (force) tbl.Clear();
if (tbl.Count > 0) return;
databases.tmpDS.investorDataTable newTbl = Libs.GetInvestorShortList();
if (newTbl != null) common.system.Concat(newTbl, 0, tbl);
}
开发者ID:oghenez,项目名称:trade-software,代码行数:7,代码来源:appLibs.cs
示例3: InitData
public static void InitData(databases.baseDS.sysCodeCatRow row)
{
row.category = "";
row.description = "";
row.isSystem = false;
row.isVisible = true;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:7,代码来源:AppLibs.cs
示例4: IsSameData
public bool IsSameData(databases.importDS.importPriceRow row1, databases.importDS.importPriceRow row2)
{
if (row1==null && row2==null) return false;
if (row1 == null && row2 != null) return false;
if (row1 != null && row2 == null) return false;
return (row1.closePrice == row2.closePrice) &&(row1.volume == row2.volume);
}
开发者ID:oghenez,项目名称:trade-software,代码行数:7,代码来源:dataClass.cs
示例5: DeletePortfolioData
private void DeletePortfolioData(databases.baseDS.portfolioDetailDataTable dataTbl, string portfolioCode,string code)
{
for (int idx = 0; idx < dataTbl.Count; idx++)
{
if (dataTbl[idx].RowState== DataRowState.Deleted) continue;
if ( (dataTbl[idx].portfolio==portfolioCode) && (dataTbl[idx].code==code) )
dataTbl[idx].Delete();
}
}
开发者ID:oghenez,项目名称:trade-software,代码行数:9,代码来源:addToWatchList_StockOnly.cs
示例6: Diagnose
public void Diagnose(string exchangeCode,commonTypes.AppTypes.PriceDataType dataType, double allowVariantPerc, ref databases.tmpDS.priceDiagnoseDataTable priceDiagnoseTbl)
{
databases.tmpDS.stockCodeDataTable codeTbl = new databases.tmpDS.stockCodeDataTable();
databases.DbAccess.LoadStockCode_ByStockExchange(codeTbl, exchangeCode, AppTypes.CommonStatus.Enable);
for (int idx = 0; idx < codeTbl.Count; idx++)
{
//Diagnose(dataType,allowVariantPerc, ref databases.tmpDS.priceDiagnoseDataTable priceDiagnoseTbl)
}
}
开发者ID:oghenez,项目名称:trade-software,代码行数:10,代码来源:dataClass.cs
示例7: ImportFromWeb
public virtual bool ImportFromWeb(DateTime updateTime, databases.baseDS.exchangeDetailRow exchangeDetailRow)
{
databases.baseDS.priceDataDataTable priceTbl = GetImportFromWeb(updateTime, exchangeDetailRow);
if (priceTbl == null) return false;
// Different culture has different start of week, ie in VN culture : start of week is Monday (not Sunday)
CultureInfo exchangeCulture = application.AppLibs.GetExchangeCulture(exchangeDetailRow.marketCode);
databases.AppLibs.AggregatePriceData(priceTbl, exchangeCulture, null);
return true;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:10,代码来源:dataClass.cs
示例8: GetPriceFromWeb
/// <summary>
/// Private - SU dung ASPWebservices
/// </summary>
/// <param name="updateTime"></param>
/// <param name="exchangeDetailRow"></param>
/// <returns></returns>
private databases.importDS.importPriceDataTable GetPriceFromWeb(DateTime updateTime, databases.baseDS.exchangeDetailRow exchangeDetailRow)
{
try
{
databases.importDS.importPriceDataTable importPriceTbl = new databases.importDS.importPriceDataTable();
if (ssiPage==null)
ssiPage = new SSIPage("http://banggia2.ssi.com.vn/", "http://banggia2.ssi.com.vn/Hnx.aspx");
//ssiPage = new SSIPage("file:///C:/Temp/selenium/HOSE%20-%20CTCP%20ch%E1%BB%A9ng%20kho%C3%A1n%20S%C3%A0i%20G%C3%B2n%20-%20B%E1%BA%A3ng%20gi%C3%A1%20tr%E1%BB%B1c%20tuy%E1%BA%BFn.html", "file:///C:/Temp/selenium/HNX%20-%20CTCP%20ch%E1%BB%A9ng%20kho%C3%A1n%20S%C3%A0i%20G%C3%B2n%20-%20B%E1%BA%A3ng%20gi%C3%A1%20tr%E1%BB%B1c%20tuy%E1%BA%BFn.html");
ssiPage.getHOSEData();
ssiPage.getHNXData();
//SaveDatatoImportPriceDataTable(updateTime,importPriceTbl);
databases.importDS.importPriceRow importRow = null;
databases.importDS.importPriceRow oldImportRow;
foreach (var stock in ssiPage.dictStocks)
{
importRow = importPriceTbl.NewimportPriceRow();
databases.AppLibs.InitData(importRow);
importRow.onDate = updateTime;
importRow.stockCode = stock.Key;
//Doi de fix error #136 - Lỗi cập nhật HNX
//importRow.isTotalVolume = true;
importRow.isTotalVolume = false;
importRow.closePrice=(decimal)stock.Value.price;
//Doi de fix error #136 - Lỗi cập nhật HNX
//importRow.volume = (decimal)stock.Value.totalVolume;
importRow.volume = (decimal)stock.Value.actualVolume;
//Doi de fix error #136 - Lỗi cập nhật HNX
if (importRow.closePrice > 0)
{
//Only add new when there are some changes
oldImportRow = lastImportData.Find(importRow);
if (!lastImportData.IsSameData(importRow, oldImportRow))
{
importPriceTbl.AddimportPriceRow(importRow);
lastImportData.Update(importRow);
}
else importRow.CancelEdit();
}
else importRow.CancelEdit();
}
return importPriceTbl;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return null;
}
开发者ID:nguyenhaiquan,项目名称:trade-software,代码行数:61,代码来源:ssiImport.cs
示例9: GetData
public static DataBars GetData(databases.baseDS.priceDataDataTable dataTbl, int startIdx)
{
DataBars bars = new DataBars();
for (int idx = startIdx; idx < dataTbl.Count; idx++)
{
bars.Add((double)dataTbl[idx].openPrice, (double)dataTbl[idx].highPrice,
(double)dataTbl[idx].lowPrice, (double)dataTbl[idx].closePrice,
(double)dataTbl[idx].volume, dataTbl[idx].onDate.ToOADate());
}
return bars;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:11,代码来源:Libs.cs
示例10: AddNewCode
//Detect new stockCode and create new one
public static void AddNewCode(string market, databases.importDS.importPriceDataTable tbl, OnCodeAdded onAddstockCodeFunc)
{
databases.baseDS.stockCodeDataTable stockCodeTbl = new databases.baseDS.stockCodeDataTable();
for (int count = 0; count < tbl.Count; count++)
{
if (tbl[count].RowState == DataRowState.Deleted) continue;
if (AddNewCode(tbl[count].stockCode, market, stockCodeTbl) != null &&
onAddstockCodeFunc != null) onAddstockCodeFunc(tbl[count].stockCode);
}
databases.DbAccess.UpdateData(stockCodeTbl);
}
开发者ID:nguyenhaiquan,项目名称:trade-software,代码行数:12,代码来源:ImportLibs.cs
示例11: FindAndCache
public static databases.tmpDS.investorRow FindAndCache(databases.tmpDS.investorDataTable tbl, string code)
{
databases.tmpDS.investorRow row = tbl.FindBycode(code);
if (row != null) return row;
if (tbl.Count == 0)
{
LoadInvestor(tbl, false);
row = tbl.FindBycode(code);
if (row != null) return row;
}
return null;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:12,代码来源:appLibs.cs
示例12: GetImportFromWeb
/// <summary>
/// Override method - /// Import stock data of HOSE and HASTC from http://banggia.ssi.com.vn/AjaxWebService.asmx
/// </summary>
/// <param name="updateTime"></param>
/// <param name="exchangeDetailRow"></param>
/// <returns></returns>
public override databases.baseDS.priceDataDataTable GetImportFromWeb(DateTime updateTime, databases.baseDS.exchangeDetailRow exchangeDetailRow)
{
databases.importDS.importPriceDataTable importPriceTbl = GetPriceFromWeb(updateTime, exchangeDetailRow);
if (importPriceTbl == null) return null;
Imports.Libs.AddNewCode(exchangeDetailRow.marketCode, importPriceTbl, null);
databases.DbAccess.UpdateData(importPriceTbl);
databases.baseDS.priceDataDataTable priceTbl = new databases.baseDS.priceDataDataTable();
Imports.Libs.AddImportPrice(importPriceTbl, priceTbl);
databases.DbAccess.UpdateData(priceTbl);
return priceTbl;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:18,代码来源:ssiImport.cs
示例13: GetDataList
public static double[] GetDataList(databases.baseDS.priceDataDataTable dataTbl, int startIdx,int endIdx,AppTypes.PriceDataType type)
{
double[] data = new double[endIdx - startIdx+1];
switch (type)
{
case AppTypes.PriceDataType.High:
for (int i = startIdx, j = 0; i <= endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = (double)dataTbl[i].highPrice;
}
break;
case AppTypes.PriceDataType.Low:
for (int i = startIdx, j = 0; i <=endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = (double)dataTbl[i].lowPrice;
}
break;
case AppTypes.PriceDataType.Open:
for (int i = startIdx, j = 0; i <= endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = (double)dataTbl[i].openPrice;
}
break;
case AppTypes.PriceDataType.Close:
for (int i = startIdx, j = 0; i <= endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = (double)dataTbl[i].closePrice;
}
break;
case AppTypes.PriceDataType.Volume:
for (int i = startIdx, j = 0; i <= endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = (double)dataTbl[i].volume;
}
break;
case AppTypes.PriceDataType.DateTime:
for (int i = startIdx, j = 0; i <= endIdx; i++, j++)
{
if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
data[j] = dataTbl[i].onDate.ToOADate();
}
break;
default:
common.system.ThrowException("Invalid dataField in MakeDataList()"); break;
}
return data;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:53,代码来源:Libs.cs
示例14: ShowNew
public bool ShowNew(databases.baseDS.tradeAlertRow alertRow)
{
this.Refresh();
qtyEd.Value = 0; subTotalEd.Value = 0; feeAmtEd.Value = 0; totalAmtEd.Value = 0;
portfolioCb.myValue = alertRow.portfolio;
codeEd.Text = alertRow.stockCode.Trim();
transTypeCb.myValue = (AppTypes.TradeActions)alertRow.tradeAction;
statusCb.myValue = AppTypes.CommonStatus.New;
SetFocus();
ShowDialog();
return true;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:12,代码来源:transactionFromAlert.cs
示例15: ShowTradeTransactions
protected void ShowTradeTransactions(databases.tmpDS.stockCodeRow stockCodeRow, string strategyCode, DataParams dataParam)
{
string formName = stockCodeRow.code.Trim() + "," + dataParam.TimeRange.ToString() + "," + application.Strategy.StrategyLibs.GetMetaName(strategyCode) + "," + dataParam.TimeScale;
profitEstimate myForm = profitEstimate.GetForm(formName);
myForm.myDataParam = dataParam;
myForm.myStockCode = stockCodeRow.code;
myForm.myStrategyCode = strategyCode;
myForm.myOptions = new EstimateOptions();
myForm.ReLoad();
myForm.Text = "(" + formName + ")";
if (this.myDockedPane != null) myForm.Show(this.myDockedPane);
else myForm.ShowDialog();
}
开发者ID:oghenez,项目名称:trade-software,代码行数:13,代码来源:baseTesting.cs
示例16: GetImportFromWeb
public override databases.baseDS.priceDataDataTable GetImportFromWeb(DateTime updateTime, databases.baseDS.exchangeDetailRow exchangeDetailRow)
{
if (!Get_IDX_HASTC(exchangeDetailRow.address, ref hastcIdx)) return null;
databases.importDS.importPriceDataTable importPriceTbl = new databases.importDS.importPriceDataTable();
AddImportRow(updateTime, hastcIdx, true, importPriceTbl);
Imports.Libs.AddNewCode(exchangeDetailRow.marketCode, importPriceTbl, null);
databases.DbAccess.UpdateData(importPriceTbl);
databases.baseDS.priceDataDataTable priceTbl = new databases.baseDS.priceDataDataTable();
Imports.Libs.AddImportPrice(importPriceTbl, priceTbl);
databases.DbAccess.UpdateData(priceTbl);
return priceTbl;
}
开发者ID:nguyenhaiquan,项目名称:trade-software,代码行数:14,代码来源:vseImport.cs
示例17: MakeData
private static commonClass.DataSeries MakeData(databases.tmpDS.marketDataDataTable dataTbl, DataFields type)
{
commonClass.DataSeries ds = new commonClass.DataSeries();
switch (type)
{
case DataFields.Count:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].val0); break;
case DataFields.Volume:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].val1); break;
case DataFields.DateTime:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].onDate.ToOADate()); break;
}
return ds;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:14,代码来源:dataClass.cs
示例18: Update
public void Update(databases.importDS.importPriceRow row)
{
databases.importDS.importPriceRow oldRow = Find(row);
if (oldRow == null)
{
oldRow = dataTbl.NewimportPriceRow();
databases.AppLibs.InitData(oldRow);
dataTbl.AddimportPriceRow(oldRow);
}
oldRow.onDate = row.onDate;
oldRow.stockCode = row.stockCode;
oldRow.closePrice = row.closePrice;
oldRow.volume = row.volume;
oldRow.isTotalVolume = row.isTotalVolume;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:15,代码来源:dataClass.cs
示例19: OnUpdateData
private void OnUpdateData(databases.baseDS.priceDataRow row, importStat stat)
{
if (fCanceled) stat.cancel =true;
this.ShowMessage(stat.updateCount.ToString("###,###,##0") + "/" +
stat.errorCount.ToString("###,###,##0") + "/" +
stat.dataCount.ToString("###,###,##0"), "Import");
//Do Aggregate and reset import to clear system resource
if (myDataSet.priceData.Count > constNumberOfImportInBatch)
{
databases.DbAccess.UpdateData(myDataSet.priceData);
DoAggregate(myDataSet.priceData, marketCultureInfo);
myDataSet.priceData.Clear();
}
}
开发者ID:oghenez,项目名称:trade-software,代码行数:15,代码来源:importPriceData.cs
示例20: ImportFromWeb
public static bool ImportFromWeb(DateTime updateTime, databases.baseDS.exchangeDetailRow exchangeDetailRow)
{
bool retVal = true;
switch (exchangeDetailRow.code.Trim().ToUpper())
{
case "HOSE_MHBS":
Stock.hoseImport hoseImport = new Stock.hoseImport();
retVal = hoseImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "HASTC_MHBS":
Stock.htastcImport htastcImport = new Stock.htastcImport();
retVal = htastcImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "HOSE_SSI":
case "HASTC_SSI":
Stock.ssi_StockImport ssiStockImport = new Stock.ssi_StockImport();
retVal = ssiStockImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "VNIDX_SSI":
Stock.ssi_vnIdxImport vnIdxSSI = new Stock.ssi_vnIdxImport();
retVal = vnIdxSSI.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "VNIDX_VSE":
Stock.vnIdxImport vnIdxVSE = new Stock.vnIdxImport();
retVal = vnIdxVSE.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "HN_IDX1": //??
Stock.hnIdxImport hnIdxImport = new Stock.hnIdxImport();
retVal = hnIdxImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "GOLD_FOREX":
Gold.forexImport forexImport = new Gold.forexImport();
retVal = forexImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
case "GOLD_KITCO":
Gold.kitcoImport kitcoImport = new Gold.kitcoImport();
retVal = kitcoImport.ImportFromWeb(updateTime, exchangeDetailRow);
break;
}
return retVal;
}
开发者ID:oghenez,项目名称:trade-software,代码行数:45,代码来源:ImportLibs.cs
注:本文中的databases类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论