public static databases.baseDS.portfolioRow UpdateData(databases.baseDS.portfolioRow row) { try { lock (myClient) { databases.baseDS.portfolioDataTable tbl = new databases.baseDS.portfolioDataTable(); tbl.ImportRow(row); myClient.UpdatePortfolio(ref tbl); row.AcceptChanges(); return tbl[0]; } } catch (Exception er) { if (OnError != null) OnError(er); } return null; }
public void LoadData(string investorCode, bool AddAllItem) { databases.baseDS.portfolioDataTable tbl = new databases.baseDS.portfolioDataTable(); if (AddAllItem) { databases.baseDS.portfolioRow row = tbl.NewportfolioRow(); databases.AppLibs.InitData(row); row.investorCode = investorCode; row.name = Settings.sysString_All_Description; row.code = Settings.sysString_All_Code; tbl.AddportfolioRow(row); } databases.baseDS.portfolioDataTable tmpTbl = DataAccess.Libs.GetPortfolio_ByInvestor(investorCode); for (int idx = 0; idx < tmpTbl.Count; idx++) tbl.ImportRow(tmpTbl[idx]); this.DisplayMember = tbl.nameColumn.ColumnName; this.ValueMember = tbl.codeColumn.ColumnName; this.DataSource = tbl; if (tbl.Count > 0) this.MaxDropDownItems = tbl.Count; }