コード例 #1
0
        private void FxEnter()
        {
            string lUserName = TxtUserName.Text.Trim();
            string lPassword = TxtPassword.Text.Trim();

            if (lUserName.Length == 0 || lPassword.Length == 0)
            {
                ClsFunctions.FxMessage(1, "Usuario y/o contraseña incorrectos");

                TxtUserName.Text = "";
                TxtPassword.Text = "";

                TxtUserName.Focus();

                return;
            }

            long lUserId = ClsSql.Fx_sel_tblUser_checkPassword(lUserName, lPassword);

            if (lUserId == 0)
            {
                ClsFunctions.FxMessage(1, "Usuario y/o contraseña incorrectos");

                TxtUserName.Text = "";
                TxtPassword.Text = "";

                TxtUserName.Focus();

                return;
            }

            if (lPassword == "centuria")
            {
                FrmChangePassword ObjForm = new FrmChangePassword();

                ObjForm.ShowDialog();

                if (ClsVariables.gPasswordChanged == false)
                {
                    ClsFunctions.FxMessage(1, "No es posible ingresar si no cambia su contraseña. Favor vuelva a intentar");

                    FxCancel();

                    return;
                }
            }

            if (ClsVariables.gPasswordExpiry > 0)
            {
                if (ClsVariables.gUserExpirationDate <= DateTime.Today)
                {
                    FrmChangePassword ObjForm = new FrmChangePassword();

                    ObjForm.ShowDialog();

                    if (ClsVariables.gPasswordChanged == false)
                    {
                        ClsFunctions.FxMessage(1, "No es posible ingresar si no cambia su contraseña. Favor vuelva a intentar");

                        FxCancel();

                        return;
                    }
                }
                else
                {
                    ClsFunctions.FxExpirationAlert();
                }
            }

            FxExit();
        }
コード例 #2
0
ファイル: FrmMainMenu.cs プロジェクト: grupocenturia/Projects
        private void FxChangePassword()
        {
            FrmChangePassword ObjForm = new FrmChangePassword();

            ObjForm.ShowDialog();
        }