public bool Find(string account, bool ShowSelectionIfNotFound) { try { selectedDataRow = null; investorSource.Filter = ""; account = account.Trim(); if (account != "") { investorSource.DataSource = DataAccess.Libs.GetInvestor_ByAccount(account); if (investorSource.Count > 0) { selectedDataRow = (databases.baseDS.investorRow)(((DataRowView)investorSource.Current).Row); return true; } if (!ShowSelectionIfNotFound) return false; } LoadData(); this.ShowDialog(); return (this.selectedDataRow != null); } catch (Exception er) { this.ShowError(er); } return false; }
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 override void AddNew(string code) { databases.baseDS.investorRow lastRow = (databases.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row; databases.baseDS.investorRow row = (databases.baseDS.investorRow)((DataRowView)myMasterSource.AddNew()).Row; if (row == null) { return; } databases.AppLibs.InitData(row); row.code = Consts.constMarkerNEW; if (lastRow != null) { row.catCode = lastRow.catCode; if (!lastRow.IscountryNull()) { row.country = lastRow.country; } } int position = myMasterSource.Position; myMasterSource.Position = -1; myMasterSource.Position = position; //CurrentDataChanged(); SetFirstFocus(); }
public bool Find(string account, bool ShowSelectionIfNotFound) { try { selectedDataRow = null; investorSource.Filter = ""; account = account.Trim(); if (account != "") { investorSource.DataSource = DataAccess.Libs.GetInvestor_ByAccount(account); if (investorSource.Count > 0) { selectedDataRow = (databases.baseDS.investorRow)(((DataRowView)investorSource.Current).Row); return(true); } if (!ShowSelectionIfNotFound) { return(false); } } LoadData(); this.ShowDialog(); return(this.selectedDataRow != null); } catch (Exception er) { this.ShowError(er); } return(false); }
protected override void UpdateData(DataRow row) { if (row == null) { return; } databases.baseDS.investorRow investorRow = row as databases.baseDS.investorRow; investorRow.ItemArray = DataAccess.Libs.UpdateData(row as databases.baseDS.investorRow).ItemArray; investorRow.AcceptChanges(); }
private void selectBtn_Click(object sender, EventArgs e) { if (investorSource.Current == null) { selectedDataRow = null; } else { selectedDataRow = (databases.baseDS.investorRow)(((DataRowView)investorSource.Current).Row); } this.Close(); }
protected override void RemoveCurrent() { this.ShowMessage(""); if (myMasterSource.Current == null) { return; } databases.baseDS.investorRow row = (databases.baseDS.investorRow)(myMasterSource.Current as DataRowView).Row; if (row.HasVersion(DataRowVersion.Original)) { DataAccess.Libs.DeleteData(row); } myMasterSource.RemoveCurrent(); this.ShowMessage(Languages.Libs.GetString("dataWasDeleted")); }
public static void InitData(databases.baseDS.investorRow row) { row.code = ""; row.type = 0; row.firstName = ""; row.lastName = ""; row.displayName = ""; row.sex = (byte)AppTypes.Sex.Unspecified; row.address1 = ""; row.email = ""; row.displayName = ""; row.account = ""; row.password = ""; row.catCode = ""; row.expireDate = DateTime.Today.AddDays(Settings.sysDefaultLoginAccountDayToExpire); row.status = (byte)AppTypes.CommonStatus.Enable; }
public static databases.baseDS.investorRow FindAndCache(databases.baseDS.investorDataTable tbl, string code) { databases.baseDS.investorRow row = tbl.FindBycode(code); if (row != null) { return(row); } databases.baseDSTableAdapters.investorTA dataTA = new databases.baseDSTableAdapters.investorTA(); dataTA.ClearBeforeFill = false; dataTA.FillByCode(tbl, code); row = tbl.FindBycode(code); if (row != null) { return(row); } return(null); }
private void selectBtn_Click(object sender, EventArgs e) { if (investorSource.Current == null) selectedDataRow =null; else selectedDataRow = (databases.baseDS.investorRow)(((DataRowView)investorSource.Current).Row); this.Close(); }