Ejemplo n.º 1
0
        private void SetDetailGrid()
        {
            databases.baseDS.investorDataTable investorTbl = new databases.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.ReadOnly = true;

            common.system.AutoFitGridColumn(dataGrid, this.displayNameColumn.Name);
        }
Ejemplo n.º 2
0
        public bool DoLogin()
        {
            ClearNotifyError();
            string account  = this.accountEd.Text.Trim();
            string password = this.passwordEd.Text.Trim();

            if (account == "")
            {
                NotifyError(accountLbl);
                return(false);
            }
            databases.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();
            commonClass.SysLibs.sysLoginDisplayName = investorTbl[0].displayName.Trim();
            commonClass.SysLibs.sysLoginType        = (commonTypes.AppTypes.UserTypes)investorTbl[0].type;
            return(true);
        }
Ejemplo n.º 3
0
        private void SetDetailGrid()
        {
            databases.baseDS.investorDataTable investorTbl = new databases.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.ReadOnly = true;

            common.system.AutoFitGridColumn(dataGrid, this.displayNameColumn.Name);
        }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
0
 public static databases.baseDS.investorRow UpdateData(databases.baseDS.investorRow row)
 {
     try
     {
         lock (myClient)
         {
             databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
             tbl.ImportRow(row);
             myClient.UpdateInvestor(ref tbl);
             row.AcceptChanges();
             return tbl[0];
         }
     }
     catch (Exception er)
     {
         if (OnError != null) OnError(er);
     }
     return null;
 }
Ejemplo n.º 6
0
 public static databases.baseDS.investorDataTable GetInvestor_ByCriteria(string criteria)
 {
     try
     {
         lock (myClient)
         {
             databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
             return myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName + (criteria.Trim() == "" ? "" : " WHERE " + criteria));
         }
     }
     catch (Exception er)
     {
         if (OnError != null) OnError(er);
     }
     return null;
 }
Ejemplo n.º 7
0
 public static databases.baseDS.investorDataTable GetInvestor_ByAccount(string account)
 {
     try
     {
         lock (myClient)
         {
             databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
             return myClient.GetInvestor_BySQL("SELECT * FROM " + tbl.TableName +
                                                " WHERE " + tbl.accountColumn.ColumnName + "=N'" + account + "'");
         }
     }
     catch (Exception er)
     {
         if (OnError != null) OnError(er);
     }
     return null;
 }
Ejemplo n.º 8
0
 public bool UpdateInvestor(ref databases.baseDS.investorDataTable investorTbl)
 {
     return(base.Channel.UpdateInvestor(ref investorTbl));
 }
Ejemplo n.º 9
0
 public databases.baseDS.investorDataTable GetInvestor_BySQL(string sql)
 {
     try
     {
         databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
         databases.DbAccess.LoadFromSQL(tbl, sql);
         return tbl;
     }
     catch (Exception ex)
     {
         WriteSysLogLocal("WS013", ex);
     }
     return null;
 }
Ejemplo n.º 10
0
 public databases.baseDS.investorDataTable GetInvestor_ByEmail(string email)
 {
     try
     {
         databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
         databases.DbAccess.LoadInvestorByEmail(tbl, email);
         return tbl;
     }
     catch (Exception ex)
     {
         WriteSysLogLocal("WS016", ex);
     }
     return null;
 }
Ejemplo n.º 11
0
 public databases.baseDS.investorDataTable GetInvestor_ByCode(string code)
 {
     try
     {
         databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
         databases.DbAccess.LoadData(tbl, code);
         return tbl;
     }
     catch (Exception ex)
     {
         WriteSysLogLocal("WS014", ex);
     }
     return null;
 }
Ejemplo n.º 12
0
 public databases.baseDS.investorDataTable GetInvestor_ByAccount(string account)
 {
     try
     {
         databases.baseDS.investorDataTable tbl = new databases.baseDS.investorDataTable();
         databases.DbAccess.LoadInvestorByAccount(tbl, account);
         return tbl;
     }
     catch (Exception ex)
     {
         WriteSysLogLocal("WS015", ex);
     }
     return null;
 }
Ejemplo n.º 13
0
        protected bool DataValid()
        {
            this.ShowMessage("");
            bool   retVal       = true;
            string loginName    = this.loginEd.Text.Trim();
            string oldPassword  = this.oldPasswordEd.Text.Trim();
            string newPassword1 = this.newPassword1Ed.Text;
            string newPassword2 = this.newPassword2Ed.Text;

            if (loginName == "")
            {
                NotifyError(newPassword1Lbl);
                retVal = false;
            }
            bool checkWeakPass = true;

            if (checkWeakPass && Settings.sysGlobal.UseStrongPassword)
            {
                common.Password.PasswordAttrib pwdAttrib = common.Password.GetPasswordAttrib(newPassword1Ed.Text.Trim());
                if (pwdAttrib.score != common.Password.PasswordScore.Strong && pwdAttrib.score != common.Password.PasswordScore.VeryStrong)
                {
                    this.ShowMessage(Languages.Libs.GetString("weakPassReEnter"));
                    NotifyError(newPassword1Ed);
                    checkWeakPass = false;
                    retVal        = false;
                }
            }
            if (checkWeakPass && newPassword1Ed.Text.Trim().Length < Settings.sysGlobal.PasswordMinLen)
            {
                this.ShowMessage(Languages.Libs.GetString("weakPassReEnter"));
                NotifyError(newPassword1Lbl);
                retVal = false;
            }

            if (newPassword1 != newPassword2)
            {
                this.ShowMessage(Languages.Libs.GetString("passwordNotMatched"));
                NotifyError(newPassword1Lbl);
                NotifyError(newPassword2Lbl);
                retVal = false;
            }
            databases.baseDS.investorDataTable investorTbl = DataAccess.Libs.GetInvestor_ByAccount(loginName);
            if (investorTbl.Count == 0)
            {
                this.ShowMessage(String.Format(Languages.Libs.GetString("loginNotFount"), loginName));
                NotifyError(loginLbl);
                retVal = false;
            }
            else
            {
                if (oldPasswordEd.Enabled && oldPassword != investorTbl[0].password.Trim())
                {
                    NotifyError(oldPasswordLbl);
                    retVal = false;
                }
            }
            if (retVal)
            {
                investorTbl[0].password = this.newPassword1Ed.Text.Trim();
                DataAccess.Libs.UpdateData(investorTbl[0]);
                this.ShowMessage(Languages.Libs.GetString("dataSaved"));
            }
            return(retVal);
        }