Beispiel #1
0
        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;
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 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();
 }
Beispiel #6
0
 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();
 }
Beispiel #7
0
 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"));
 }
Beispiel #8
0
 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;
 }
Beispiel #9
0
 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);
 }
Beispiel #10
0
 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();
 }