Beispiel #1
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;
                }
                data.baseDS.investorRow investorRow = (data.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row;
                watchListEdit           form        = watchListEdit.GetForm("");
                form.myInvestorCode = investorRow.code;

                if (this.myDockedPane != null)
                {
                    form.Show(this.myDockedPane);
                }
                else
                {
                    form.ShowDialog();
                }
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
        }
Beispiel #2
0
        public override void AddNew(string code)
        {
            data.baseDS.investorRow lastRow = (data.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row;
            data.baseDS.investorRow row     = (data.baseDS.investorRow)((DataRowView)myMasterSource.AddNew()).Row;
            if (row == null)
            {
                return;
            }
            commonClass.AppLibs.InitData(row);
            row.code = Consts.constNotMarkerNEW;
            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 #3
0
 public static data.baseDS.investorRow UpdateData(data.baseDS.investorRow row)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     tbl.ImportRow(row);
     myClient.UpdateInvestor(ref tbl);
     row.AcceptChanges();
     return(tbl[0]);
 }
Beispiel #4
0
 protected virtual void CurrentDataChanged()
 {
     if (myMasterSource.Current == null)
     {
         return;
     }
     data.baseDS.investorRow investorRow = (data.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row;
     passwordEd2.Text = investorRow.password;
     LockEdit(this.isLockEdit);
 }
Beispiel #5
0
 protected override void UpdateData(DataRow row)
 {
     if (row == null)
     {
         return;
     }
     data.baseDS.investorRow investorRow = (investorSource.Current as DataRowView).Row as data.baseDS.investorRow;
     investorRow.ItemArray = DataAccess.Libs.UpdateData(row as data.baseDS.investorRow).ItemArray;
     investorRow.AcceptChanges();
 }
Beispiel #6
0
        private void EditWatchList()
        {
            if (this.isNewRow(((DataRowView)myMasterSource.Current).Row))
            {
                common.system.ShowMessage(Languages.Libs.GetString("pleaseSaveBeforeContinue"));
                return;
            }
            data.baseDS.investorRow investorRow = (data.baseDS.investorRow)((DataRowView)myMasterSource.Current).Row;

            //myWatchListEditForm.ShowForm(investorRow.code);
        }
Beispiel #7
0
 protected override void RemoveCurrent()
 {
     this.ShowMessage("");
     if (myMasterSource.Current == null)
     {
         return;
     }
     data.baseDS.investorRow row = (data.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(data.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 void DeleteData(data.baseDS.investorRow row)
 {
     myClient.DeleteInvestor(row.code);
 }