protected override void SaveData() { common.MultiValueString mvString = new common.MultiValueString(); databases.baseDS.portfolioDataTable portfolioTbl = new databases.baseDS.portfolioDataTable(); databases.baseDS.portfolioDetailDataTable portfolioDataTbl; portfolioTbl.Clear(); for (int portfolioIdx = 0; portfolioIdx < watchListLb.myCheckedValues.Count; portfolioIdx++) { databases.baseDS.portfolioRow portfolioRow = DataAccess.Libs.GetPortfolio_ByCode(watchListLb.myCheckedValues[portfolioIdx]); if (portfolioRow == null) { continue; } mvString.myFormatString = portfolioRow.interestedStock; mvString.Add(codeEd.Text); portfolioRow.interestedStock = mvString.myFormatString; portfolioDataTbl = DataAccess.Libs.GetPortfolioDetail_ByCode(portfolioRow.code); databases.baseDS.portfolioDetailRow dataRow; for (int idx = 0; idx < myStrategyCodes.Count; idx++) { dataRow = portfolioDataTbl.FindByportfoliocodesubCode(portfolioRow.code, this.codeEd.Text, this.myStrategyCodes[idx]); if (dataRow == null) { dataRow = portfolioDataTbl.NewportfolioDetailRow(); databases.AppLibs.InitData(dataRow); dataRow.portfolio = portfolioRow.code; dataRow.code = codeEd.Text; dataRow.subCode = this.myStrategyCodes[idx]; portfolioDataTbl.AddportfolioDetailRow(dataRow); } mvString.myFormatString = dataRow.data; mvString.Add(timeScaleCb.myValue.Code); dataRow.data = mvString.myFormatString; } DataAccess.Libs.UpdateData(portfolioRow); DataAccess.Libs.UpdateData(portfolioDataTbl); } common.system.ShowMessage(Languages.Libs.GetString("dataSaved")); }
protected override void SaveData() { common.MultiValueString mvString = new common.MultiValueString(); databases.baseDS.portfolioDataTable portfolioTbl = new databases.baseDS.portfolioDataTable(); databases.baseDS.portfolioDetailDataTable portfolioDataTbl; portfolioTbl.Clear(); for (int portfolioIdx = 0; portfolioIdx < watchListLb.myCheckedValues.Count; portfolioIdx++) { databases.baseDS.portfolioRow portfolioRow = DataAccess.Libs.GetPortfolio_ByCode(watchListLb.myCheckedValues[portfolioIdx]); if (portfolioRow == null) continue; mvString.myFormatString = portfolioRow.interestedStock; mvString.Add(codeEd.Text); portfolioRow.interestedStock = mvString.myFormatString; portfolioDataTbl = DataAccess.Libs.GetPortfolioDetail_ByCode(portfolioRow.code); databases.baseDS.portfolioDetailRow dataRow; for (int idx = 0; idx < myStrategyCodes.Count; idx++) { dataRow = portfolioDataTbl.FindByportfoliocodesubCode(portfolioRow.code, this.codeEd.Text, this.myStrategyCodes[idx]); if (dataRow == null) { dataRow = portfolioDataTbl.NewportfolioDetailRow(); databases.AppLibs.InitData(dataRow); dataRow.portfolio = portfolioRow.code; dataRow.code = codeEd.Text; dataRow.subCode = this.myStrategyCodes[idx]; portfolioDataTbl.AddportfolioDetailRow(dataRow); } mvString.myFormatString = dataRow.data; mvString.Add(timeScaleCb.myValue.Code); dataRow.data = mvString.myFormatString; } DataAccess.Libs.UpdateData(portfolioRow); DataAccess.Libs.UpdateData(portfolioDataTbl); } common.system.ShowMessage(Languages.Libs.GetString("dataSaved")); }