public bool PalabraPalindromo(ref DAL.DALPalindromo.clsPalindromo objDAL)
        {
            try
            {
                foreach (char letras in objDAL.Palabra)
                {
                    lst.Insercion(letras);
                }

                return(lst.EsPalindromo());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        protected void btnComprobar_Click(object sender, EventArgs e)
        {
            try
            {
                lblError.ForeColor = Color.Blue;
                BLL.BLLPalindromo.clsPalindromo objBLL = new BLL.BLLPalindromo.clsPalindromo();
                DAL.DALPalindromo.clsPalindromo objDAL = new DAL.DALPalindromo.clsPalindromo();

                objDAL.Palabra = txtValores.Value.Replace(" ", "").ToUpper();
                if (objBLL.PalabraPalindromo(ref objDAL))
                {
                    lblError.Text = "Es palíndromo";
                }
                else
                {
                    lblError.Text = "No es palíndromo";
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.ToString();
            }
        }