コード例 #1
0
        /// <summary>
        /// Inserimento della nuova password per l'utente amministratore
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="password"></param>
        /// <param name="passwordConfirm"></param>
        /// <param name="failDetails"></param>
        /// <returns></returns>
        protected virtual bool SetNewPassword(string userID,
                                              string pwd, string pwdConfirm,
                                              out string failDetails)
        {
            bool retValue = false;

            failDetails = string.Empty;

            // Verifica della validità della nuova password immessa
            retValue = (pwd.Trim().Length > 0 && pwdConfirm.Trim().Length > 0);

            if (!retValue)
            {
                failDetails = "Immettere la nuova password";
            }
            else if (string.Compare(pwd, pwdConfirm, false) != 0)
            {
                failDetails = "I valori immessi nei campi password e conferma password non coincidono";
                retValue    = false;
            }

            if (retValue)
            {
                AmmUtils.WebServiceLink ws = new AmmUtils.WebServiceLink();
                DocsPAWA.DocsPaWR.ValidationResultInfo result = ws.AdminChangePassword(this.txt_newPwd.Text);

                retValue = (result.Value);

                if (!retValue)
                {
                    failDetails = result.BrokenRules[0].Description;
                }
            }

            return(retValue);
        }