Beispiel #1
0
        private void SetDetailGrid()
        {
            data.baseDS.investorDataTable investorTbl = new data.baseDS.investorDataTable();
            //
            // codeColumn
            //
            this.codeColumn.DataPropertyName = investorTbl.codeColumn.ColumnName;
            this.codeColumn.HeaderText       = "Code";
            this.codeColumn.Name             = "codeColumn";
            this.codeColumn.ReadOnly         = true;
            //
            // displayNameColumn
            //
            this.displayNameColumn.DataPropertyName = investorTbl.displayNameColumn.ColumnName;
            this.displayNameColumn.HeaderText       = "Name";
            this.displayNameColumn.Name             = "displayNameColumn";
            this.displayNameColumn.ReadOnly         = true;

            //
            // dataGrid
            //

            this.dataGrid.DataSource = this.myMasterSource;
            this.dataGrid.Columns.Clear();
            this.dataGrid.Columns.AddRange(new DataGridViewColumn[] { this.codeColumn, this.displayNameColumn });
            this.dataGrid.DisableReadOnlyColumn = false;
            this.dataGrid.ReadOnly = true;
            common.system.AutoFitGridColumn(dataGrid, this.displayNameColumn.Name);
        }
        public bool DoLogin()
        {
            ClearNotifyError();
            string account  = this.accountEd.Text.Trim();
            string password = this.passwordEd.Text.Trim();

            if (account == "")
            {
                NotifyError(accountLbl);
                return(false);
            }
            data.baseDS.investorDataTable investorTbl = DataAccess.Libs.GetInvestor_ByAccount(account);
            if (investorTbl.Count == 0)
            {
                common.system.ShowErrorMessage(Languages.Libs.GetString("invalidLogin"));
                return(false);
            }
            if (investorTbl[0].password.Trim() != password.Trim())
            {
                common.system.ShowErrorMessage(Languages.Libs.GetString("invalidLogin"));
                return(false);
            }
            if (!commonClass.SysLibs.isSupperAdminLogin(investorTbl[0].account) &&
                investorTbl[0].expireDate < DataAccess.Libs.GetServerDateTime())
            {
                common.system.ShowErrorMessage(Languages.Libs.GetString("accountExpired"));
                return(false);
            }
            commonClass.SysLibs.sysLoginCode    = investorTbl[0].code.Trim();
            commonClass.SysLibs.sysLoginAccount = investorTbl[0].account.Trim();
            return(true);
        }
Beispiel #3
0
        private void SetDetailGrid()
        {
            data.baseDS.investorDataTable investorTbl = new data.baseDS.investorDataTable();
            // 
            // codeColumn
            // 
            this.codeColumn.DataPropertyName = investorTbl.codeColumn.ColumnName;
            this.codeColumn.HeaderText = "Code";
            this.codeColumn.Name = "codeColumn";
            this.codeColumn.ReadOnly = true;
            // 
            // displayNameColumn
            // 
            this.displayNameColumn.DataPropertyName = investorTbl.displayNameColumn.ColumnName;
            this.displayNameColumn.HeaderText = "Name";
            this.displayNameColumn.Name = "displayNameColumn";
            this.displayNameColumn.ReadOnly = true;
            
            // 
            // dataGrid
            // 

            this.dataGrid.DataSource = this.myMasterSource;
            this.dataGrid.Columns.Clear();
            this.dataGrid.Columns.AddRange(new DataGridViewColumn[] { this.codeColumn, this.displayNameColumn });
            this.dataGrid.DisableReadOnlyColumn = false;
            this.dataGrid.ReadOnly = true;
            common.system.AutoFitGridColumn(dataGrid, this.displayNameColumn.Name);
        }
Beispiel #4
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 #5
0
 public static void LoadData(data.baseDS.investorDataTable tbl, string code)
 {
     investorTA.ClearBeforeFill = false;
     if (code == null)
     {
         investorTA.Fill(tbl);
     }
     else
     {
         investorTA.FillByCode(tbl, code);
     }
 }
Beispiel #6
0
 public void UpdateInvestor(ref data.baseDS.investorDataTable tbl)
 {
     for (int idx = 0; idx < tbl.Count; idx++)
     {
         if (tbl[idx].code.Trim() == Consts.constNotMarkerNEW)
         {
             common.myAutoKeyInfo info = application.SysLibs.GetAutoKey(tbl.TableName, false);
             tbl[idx].code = info.value.ToString().PadLeft(tbl.codeColumn.MaxLength, '0');
         }
     }
     DbAccess.UpdateData(tbl);
 }
 private void baseAdviceEstimate_Load(object sender, EventArgs e)
 {
     try
     {
         FormResize();
         data.baseDS.investorDataTable investorTbl = new data.baseDS.investorDataTable();
         application.dataLibs.LoadData(investorTbl, application.sysLibs.sysLoginCode);
         if (investorTbl.Count > 0)
         {
             this.myInitCapitalAmt = investorTbl[0].cashAmt;
         }
     }
     catch (Exception er)
     {
         this.ShowError(er);
     }
 }
 private void baseAdviceEstimate_Load(object sender, EventArgs e)
 {
     try
     {
         FormResize();
         data.baseDS.investorDataTable investorTbl = new data.baseDS.investorDataTable();
         application.dataLibs.LoadData(investorTbl, application.sysLibs.sysLoginCode);
         if (investorTbl.Count > 0) this.myInitCapitalAmt = investorTbl[0].cashAmt;
     }
     catch (Exception er)
     {
         this.ShowError(er);
     }
 }
Beispiel #9
0
 public data.baseDS.investorDataTable GetInvestor_BySQL(string sql)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     DbAccess.LoadFromSQL(tbl, sql);
     return(tbl);
 }
Beispiel #10
0
 public data.baseDS.investorDataTable GetInvestor_ByCode(string code)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     DbAccess.LoadData(tbl, code);
     return(tbl);
 }
Beispiel #11
0
 public static void LoadInvestorByAccount(data.baseDS.investorDataTable tbl, string account)
 {
     investorTA.ClearBeforeFill = false;
     investorTA.FillByAccount(tbl, account);
 }
Beispiel #12
0
 public MarketSummary()
 {
     InitializeComponent();
     data.baseDS.investorDataTable investor = DataAccess.Libs.GetInvestor_ByCode(commonClass.SysLibs.sysLoginCode);
     TitleLbl.Text = "Hi " + investor[0].firstName + investor[0].lastName + ",\r\n" + TitleLbl.Text;
 }
Beispiel #13
0
 public static data.baseDS.investorDataTable GetInvestor_ByAccount(string account)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     return(myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName +
                                       " WHERE " + tbl.accountColumn.ColumnName + "=N'" + account + "'"));
 }
Beispiel #14
0
 public static data.baseDS.investorDataTable GetInvestor_ByCriteria(string criteria)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     return(myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName + (criteria.Trim() == ""?"":" WHERE " + criteria)));
 }
Beispiel #15
0
 public static data.baseDS.investorDataTable GetInvestor_ByCriteria(string criteria)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     return myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName + (criteria.Trim()==""?"":" WHERE " + criteria));
 }
Beispiel #16
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 #17
0
 public static data.baseDS.investorDataTable GetInvestor_ByAccount(string account)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     return myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName + 
                                        " WHERE " + tbl.accountColumn.ColumnName + "=N'" + account + "'");
 }
Beispiel #18
0
        public static void LoadInvestor(data.baseDS.investorDataTable tbl, string cond)
        {
            string sqlCmd = "SELECT * FROM investor WHERE " + cond;

            LoadFromSQL(tbl, sqlCmd);
        }
Beispiel #19
0
 public static void UpdateData(data.baseDS.investorDataTable tbl)
 {
     investorTA.Update(tbl);
     tbl.AcceptChanges();
 }
Beispiel #20
0
 public data.baseDS.investorDataTable GetInvestor_BySQL(string sql)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     DbAccess.LoadFromSQL(tbl, sql);
     return tbl;
 }
Beispiel #21
0
 public data.baseDS.investorDataTable GetInvestor_ByCode(string code)
 {
     data.baseDS.investorDataTable tbl = new data.baseDS.investorDataTable();
     DbAccess.LoadData(tbl, code);
     return tbl;
 }