/// <summary>
        /// Gets the color of the verification.
        /// </summary>
        /// <param name="vt">The verification type.</param>
        /// <returns></returns>
        protected Color GetVerificationColor(VerificationTypes vt)
        {
            switch (vt)
            {
            case VerificationTypes.Error:
                return(this.HighlightForeColorError);

            case VerificationTypes.Warning:
                return(this.HighlightForeColorWarning);

            //case VerificationTypes.Information:
            default:
                return(this.HighlightForeColorInformation);
            }
        }
Esempio n. 2
0
        public string SendSMSVerificationNotification(VerificationTypes type, string phone, string verificationCode)
        {
            string smsBody = string.Empty;

            switch (type)
            {
            case VerificationTypes.Registration:
                smsBody = string.Format("Üyeliğinizi aktive etmek için gerekli onay kodunuz {0} olup 3 dakika için geçerlidir.", verificationCode);
                break;

            case VerificationTypes.PasswordRenewal:
                smsBody = string.Format("Şifrenizi değiştirmek için gerekli onay kodunuz {0} olup 3 dakika için geçerlidir.", verificationCode);
                break;
            }

            return(SmsHelper.SendSMS(phone, smsBody));
        }
        /// <summary>
        /// Specifies the contents of the controls which show error context to the user.
        /// </summary>
        protected void SetErrorContent(string errorText, int errorIndex, int errorLength, VerificationTypes verificationType)
        {
            m_viewerControlArg          = null;
            rtbErrorText.Text           = "";
            rtbErrorText.SelectionColor = Color.Black;
            rtbErrorText.ForeColor      = Color.Black;
            rtbErrorText.Text           = errorText;

            rtbErrorText.Select(errorIndex, errorLength);
            rtbErrorText.SelectionColor = GetVerificationColor(verificationType);

            int highlightStart  = errorIndex;
            int highlightLength = errorLength;

            if (errorLength < 3)
            {
                highlightStart  -= 1;
                highlightStart   = Math.Max(highlightStart, 0);
                highlightLength += 2;
                if (highlightStart + highlightLength > rtbErrorText.Text.Length)
                {
                    highlightLength = rtbErrorText.Text.Length - highlightStart;
                }
            }

            rtbErrorText.Select(highlightStart, highlightLength);
            rtbErrorText.SelectionBackColor = HighlightBackColor;

            // Replacing footnote and formula character codes with proper words in Persian
            rtbErrorText.ScrollToCaret();
            rtbErrorText.DeselectAll();
            rtbErrorText.Rtf = rtbErrorText.Rtf.
                               Replace("\\'02", WordSpecialCharacters.FootnoteDelimiterReplacementRTF).
                               Replace("\\'01", WordSpecialCharacters.FormulaDelimiterReplacementRTF);
        }