private void watchListBtn_Click(object sender, EventArgs e) { try { if (this.isNewRow(((DataRowView)myMasterSource.Current).Row)) { common.system.ShowMessage(Languages.Libs.GetString("pleaseSaveBeforeContinue")); return; } databases.baseDS.investorRow investorRow = (databases.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row; watchListEdit form = watchListEdit.GetForm(""); if (form == null) { return; } if (this.myOnWatchListChanged != null) { form.myOnDataChanged += new onDataChanged(this.myOnWatchListChanged); } form.myInvestorCode = investorRow.code; if (this.myDockedPane != null) { form.Show(this.myDockedPane); } else { form.ShowDialog(); } } catch (Exception er) { this.ShowError(er); } }
public static watchListEdit GetForm(string formName) { string cacheKey = typeof(watchListEdit).FullName + (formName != null && formName.Trim() == "" ? "-" + formName.Trim() : ""); watchListEdit form = (watchListEdit)common.Data.dataCache.Find(cacheKey); if (form != null && !form.IsDisposed) return form; form = new watchListEdit(); common.Data.dataCache.Add(cacheKey, form); return form; }
public static watchListEdit GetForm(string formName) { string cacheKey = typeof(watchListEdit).FullName + (formName != null && formName.Trim() == "" ? "-" + formName.Trim() : ""); watchListEdit form = (watchListEdit)common.Data.dataCache.Find(cacheKey); if (form != null && !form.IsDisposed) { return(form); } form = new watchListEdit(); common.Data.dataCache.Add(cacheKey, form); return(form); }