public void init()
        {
            lafabricaDao = new FabricaDAOSqlServer();
            laFabricaEntidades = new FabricaEntidades();
            laDireccion = laFabricaEntidades.ObtenerDireccion("Venezuela", "Miranda", "Guarenas", "Nueva Casarapa, Calle 5, Edif Casarapa", "3223");
            elTelefono = laFabricaEntidades.ObtenerTelefono("0424", "1188439");
            elCliente = laFabricaEntidades.ObtenerClienteNatural("Gonzalo", "Machado", "*****@*****.**", laDireccion, elTelefono, "10351484");

             laDireccion2 = laFabricaEntidades.ObtenerDireccion("Venezuela", "Miranda", "Guarenas", "La Callena, Calle 3, Edif La Flor", "3293");
            elTelefono2 = laFabricaEntidades.ObtenerTelefono("0424", "1138419");
            elCliente2 = laFabricaEntidades.ObtenerClienteNatural("Jose","Oberto","*****@*****.**",laDireccion2,elTelefono2,"9381223");

            elCliente3 = laFabricaEntidades.ObtenerClienteNatural();
        }
Exemple #2
0
        public void init()
        {
            fabricaDAOContacto = new FabricaDAOSqlServer();
            entidadContacto = new FabricaEntidades();
            elContacto = (Contacto)entidadContacto.ObtenerContacto();
            elContacto2 = (Contacto)entidadContacto.ObtenerContacto();
            elContactoAuxiliar = (Contacto)entidadContacto.ObtenerContacto();
            elCliente = (ClienteJuridico)entidadContacto.ObtenerClienteJuridico();
            elTelefono = (Telefono)entidadContacto.ObtenerTelefono();
            laDireccion = (Direccion)entidadContacto.ObtenerDireccion();
            laListaDeContactos =new List<Contacto>();

            elTelefono.Numero = "5555555";
            elTelefono.Codigo = "0414";
            laDireccion.CodigoPostal = null;
            laDireccion.LaDireccion = "Parroquia Caricuao UD 3, Bloque 6, piso 1, apt 01";
            laDireccion.LaCiudad = "Caracas";
            laDireccion.ElEstado = "Distrito Capital";
            laDireccion.ElPais = "Venezuela";

            elContacto.ConCedula = "1000000";
            elContacto.Con_Nombre = "Prueba";
            elContacto.Con_Apellido = "Unitaria";
            elContacto.ConCargo = "Gerente";

            elContacto.Con_Telefono = elTelefono;
            elContacto.ConClienteJurid = elCliente;
            elContacto.ConClienteNat = null;

            elCliente.Id = 1;
            elCliente.Jur_Rif = "J-11111111-1";
            elCliente.Jur_Nombre = "Locatel";
            laListaDeContactos.Add(elContacto);
            elCliente.Jur_Contactos = laListaDeContactos;
            elCliente.Jur_Direccion = laDireccion;
            elCliente.Jur_Logo = null;
        }
        /// <summary>
        /// metodo para manejar el evento para agregar un cliente juridico
        /// </summary>
        /// <returns>booleano que refleja el exito de la operacion</returns>
        public bool agregarEmpresa()
        {
            List<String> alfabeticos = new List<String>();
            List<String> alfanumericos = new List<String>();
            List<String> numericos = new List<String>();
            alfabeticos.Add(vista.apellidoContacto);
            alfabeticos.Add(vista.nombreContacto);
            alfanumericos.Add(vista.direccionEmpresa);
            alfanumericos.Add(vista.nombreEmpresa);
            alfanumericos.Add(vista.rifEmpresa);
            numericos.Add(vista.cedulaContacto);
            numericos.Add(vista.codTelefono);
            numericos.Add(vista.telefonoCliente);
            Regex expresion = new Regex(@"[0-9]{1,9}(\.[0-9]{0,2})?$");

            if (Validaciones.ValidarCamposVacios(alfabeticos) && Validaciones.ValidarCamposVacios(alfabeticos) &&
                Validaciones.ValidarCamposVacios(numericos))
            {
                if (Validaciones.ValidarCaracteresAlfabeticos(alfabeticos))
                {
                        if (Validaciones.ValidarExpresionRegular(numericos,expresion))
                        {
                                FabricaEntidades fabrica = new FabricaEntidades();
                                List<Entidad> contactos = new List<Entidad>();
                            try
                            {
                                Entidad direccion = fabrica.ObtenerDireccion(vista.comboPais.SelectedValue,
                                    vista.comboEstado.SelectedValue, vista.comboCiudad.SelectedValue,
                                    vista.direccionEmpresa, vista.codigoPostalEmpresa);
                                Entidad telefono = fabrica.ObtenerTelefono(vista.codTelefono, vista.telefonoCliente);
                                Entidad contacto = fabrica.ObtenerContacto(vista.cedulaContacto, vista.nombreContacto,
                                    vista.apellidoContacto, vista.comboCargo.SelectedValue, telefono);
                                contactos.Add(contacto);
                                Entidad clientej = fabrica.ObtenerClienteJuridico(vista.nombreEmpresa, contactos, direccion, vista.rifEmpresa, "aquivaellogo");
                                Comando<Entidad, bool> comando = FabricaComandos.CrearComandoAgregarClienteJuridico();
                                if (comando.Ejecutar(clientej))
                                    HttpContext.Current.Response.Redirect(RecursoInterfazM2.ListarEmpresas +
                                        RecursoInterfazM2.Codigo_Exito_Agregar);
                                return true;
                            }
                            catch (Exception ex)
                            {
                                vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                                vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                                vista.alerta = RecursoInterfazM2.Alerta_Html +
                                    ex.Message +
                                    RecursoInterfazM2.Alerta_Html_Final;
                                return false;
                            }
                        }
                        else
                        {
                            vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                            vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                            vista.alerta = RecursoInterfazM2.Alerta_Html +
                                RecursoInterfazM2.Alerta_Error_Numericos +
                            RecursoInterfazM2.Alerta_Html_Final;
                            return false;

                        }
                }
                else
                {
                    vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                    vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                    vista.alerta = RecursoInterfazM2.Alerta_Html +
                        RecursoInterfazM2.Alerta_Error_Alfabeticos +
                    RecursoInterfazM2.Alerta_Html_Final;
                    return false;

                }
            }
            else
            {
                vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                vista.alerta = RecursoInterfazM2.Alerta_Html +
                    RecursoInterfazM2.Alerta_Error_CamposVacios +
                RecursoInterfazM2.Alerta_Html_Final;
                return false;

            }
        }
Exemple #4
0
        /// <summary>
        /// Metodo para consultar todos los datos de un cliente natural
        /// dado un id
        /// </summary>
        /// <param name="parametro">entidad que posee el id del que se desean saber
        /// todos los datos</param>
        /// <returns>cliente natural con todos sus datos</returns>
        public Entidad ConsultarXId(Entidad parametro)
        {
            FabricaEntidades laFabrica = new FabricaEntidades();
            DataTable resultado = new DataTable();
            List<Parametro> parametros = new List<Parametro>();
            Parametro elParametro;
            Direccion laDireccion;
            Telefono elTelefono;

            try
            {
                ClienteNatural elCliente = (ClienteNatural)laFabrica.ObtenerClienteNatural();
                elParametro = new Parametro(RecursoBDModulo2.ParamIDClienteNat,
                SqlDbType.Int, parametro.Id.ToString(), false);
                parametros.Add(elParametro);
                resultado = EjecutarStoredProcedureTuplas(RecursoBDModulo2.ConsultarDatosClienteNat,
                                                                     parametros);
                if (resultado == null)
                {
                    Logger.EscribirError(Convert.ToString(this.GetType()),
                                           new ClienteInexistenteException());
                    throw new ClienteInexistenteException(RecursoBDModulo2.CodigoClienteInexistente,
                                                          RecursoBDModulo2.MensajeClienteInexistente,
                                                          new ClienteInexistenteException());
                }

                foreach (DataRow row in resultado.Rows)
                {
                    laDireccion = (Direccion)laFabrica.ObtenerDireccion();
                    elTelefono = (Telefono)laFabrica.ObtenerTelefono();
                    elCliente = (ClienteNatural)laFabrica.ObtenerClienteNatural();
                    elCliente.Id = int.Parse(row[RecursoBDModulo2.AliasIDClienteNat].ToString());
                    elCliente.Nat_Nombre = row[RecursoBDModulo2.AliasNombreClienteNat].ToString();
                    elCliente.Nat_Apellido = row[RecursoBDModulo2.AliasApellidoClienteNat].ToString();
                    elCliente.Nat_Cedula = row[RecursoBDModulo2.AliasCedulaClienteNat].ToString();
                    elCliente.Nat_Correo = row[RecursoBDModulo2.AliasCorreoClienteNat].ToString();
                    elTelefono.Codigo = row[RecursoBDModulo2.AliasCodigoTelefono].ToString();
                    elTelefono.Numero = row[RecursoBDModulo2.AliasNumTelefono].ToString();
                    elCliente.Nat_Telefono = elTelefono;
                    laDireccion.LaDireccion = row[RecursoBDModulo2.AliasNombreDireccion].ToString();
                    laDireccion.CodigoPostal = row[RecursoBDModulo2.AliasCodPostalDireccion].ToString();
                    laDireccion.LaCiudad = row[RecursoBDModulo2.AliasNombreCiudad].ToString();
                    laDireccion.ElEstado = row[RecursoBDModulo2.AliasNombreEstado].ToString();
                    laDireccion.ElPais = row[RecursoBDModulo2.AliasNombrePais].ToString();
                    elCliente.Nat_Direccion = laDireccion;

                }

                return elCliente;

            }
            #region catches
            catch (SqlException ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()), ex);

                throw new ExcepcionesTotem.ExceptionTotemConexionBD(
                    RecursoGeneralDAO.Codigo_Error_BaseDatos,
                    RecursoGeneralDAO.Mensaje_Error_BaseDatos,
                    ex);
            }
            catch (ClienteInexistenteException ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()), ex);
                throw ex;

            }
            catch (ExcepcionesTotem.ExceptionTotemConexionBD ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()), ex);
                throw ex;
            }
            catch (Exception ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()), ex);

                throw new ExceptionTotem(RecursoBDModulo2.CodigoExcepcionGeneral,
                                         RecursoBDModulo2.MensajeExcepcionGeneral,
                                         ex);
            }
            #endregion
        }
Exemple #5
0
        /// <summary>
        /// Metodo para consultar todos los datos de un cliente juridico dado su ID
        /// </summary>
        /// <param name="parametro">parametro que contiene el Id del cliente a consultar</param>
        /// <returns>el cliente con todos sus datos</returns>
        public Entidad ConsultarXId(Entidad parametro)
        {
            FabricaEntidades laFabrica = new FabricaEntidades();
            DataTable resultado = new DataTable();
            List<Parametro> parametros = new List<Parametro>();
            ClienteJuridico elCliente;
            Direccion laDireccion;
            try
            {
                elCliente = (ClienteJuridico)laFabrica.ObtenerClienteJuridico();
                Parametro parametroStored = new Parametro(RecursoBDModulo2.ParamIDClienteJur,
                    SqlDbType.Int, parametro.Id.ToString(), false);
                parametros.Add(parametroStored);
                resultado = EjecutarStoredProcedureTuplas(RecursoBDModulo2.ConsultarDatosClienteJur, parametros);

                if (resultado == null)
                {
                    Logger.EscribirError(Convert.ToString(this.GetType()),
                        new ClienteInexistenteException());

                    throw new ClienteInexistenteException(RecursoBDModulo2.CodigoClienteInexistente,
                        RecursoBDModulo2.MensajeClienteInexistente, new ClienteInexistenteException());
                }

                foreach (DataRow row in resultado.Rows)
                {
                    laDireccion = (Direccion)laFabrica.ObtenerDireccion();
                    elCliente = (ClienteJuridico)laFabrica.ObtenerClienteJuridico();
                    elCliente.Id = int.Parse(row[RecursoBDModulo2.AliasClienteJurID].ToString());

                    elCliente.Jur_Nombre = row[RecursoBDModulo2.AliasClienteJurNombre].ToString();
                    elCliente.Jur_Logo = row[RecursoBDModulo2.AliasClienteJurLogo].ToString();
                    elCliente.Jur_Rif = row[RecursoBDModulo2.AliasClienteJurRif].ToString();
                    laDireccion.LaDireccion = row[RecursoBDModulo2.AliasClienteJurDireccion].ToString();
                    laDireccion.CodigoPostal = row[RecursoBDModulo2.AliasClienteJurCodPost].ToString();
                    laDireccion.LaCiudad = row[RecursoBDModulo2.AliasClienteJurCiudad].ToString();
                    laDireccion.ElEstado = row[RecursoBDModulo2.AliasClienteJurEstado].ToString();
                    laDireccion.ElPais = row[RecursoBDModulo2.AliasClienteJurPais].ToString();
                    elCliente.Jur_Direccion = laDireccion;
                }
                return elCliente;
            }
            #region Catches
            catch (ClienteInexistenteException ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw ex;
            }
            catch (SqlException ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw new ExcepcionesTotem.ExceptionTotemConexionBD(
                    RecursoGeneralDAO.Codigo_Error_BaseDatos,
                    RecursoGeneralDAO.Mensaje_Error_BaseDatos,
                    ex);
            }
            catch (ExcepcionesTotem.ExceptionTotemConexionBD ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw ex;
            }
            catch (Exception ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw new ExceptionTotem(RecursoBDModulo2.CodigoExcepcionGeneral,
                    RecursoBDModulo2.MensajeExcepcionGeneral,
                    ex);
            }
            #endregion
        }
Exemple #6
0
        /// <summary>
        /// Metodo para consultar la lista de clientes juridicos
        /// </summary>
        /// <returns>lista completa de todos los clientes juridicos en bd</returns>
        public List<Entidad> ConsultarTodos()
        {
            FabricaEntidades laFabrica = new FabricaEntidades();
            List<Entidad> laLista = new List<Entidad>();
            DataTable resultado = new DataTable();
            List<Parametro> parametros = new List<Parametro>();
            ClienteJuridico elCliente;
            Direccion laDireccion;
            try
            {
                resultado = EjecutarStoredProcedureTuplas(RecursoBDModulo2.ConsultarListaClientesJur, parametros);

                foreach (DataRow row in resultado.Rows)
                {
                    laDireccion = (Direccion)laFabrica.ObtenerDireccion();
                    elCliente = (ClienteJuridico)laFabrica.ObtenerClienteJuridico();
                    elCliente.Id = int.Parse(row[RecursoBDModulo2.AliasClienteJurID].ToString());

                    elCliente.Jur_Nombre = row[RecursoBDModulo2.AliasClienteJurNombre].ToString();
                    elCliente.Jur_Logo = row[RecursoBDModulo2.AliasClienteJurLogo].ToString();
                    elCliente.Jur_Rif = row[RecursoBDModulo2.AliasClienteJurRif].ToString();
                    laDireccion.LaDireccion = row[RecursoBDModulo2.AliasClienteJurDireccion].ToString();
                    laDireccion.CodigoPostal = row[RecursoBDModulo2.AliasClienteJurCodPost].ToString();
                    laDireccion.LaCiudad = row[RecursoBDModulo2.AliasClienteJurCiudad].ToString();
                    laDireccion.ElEstado = row[RecursoBDModulo2.AliasClienteJurEstado].ToString();
                    laDireccion.ElPais = row[RecursoBDModulo2.AliasClienteJurPais].ToString();
                    elCliente.Jur_Direccion = laDireccion;
                    laLista.Add(elCliente);
                }

                return laLista;

            }
            #region Catches
            catch (SqlException ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw new ExcepcionesTotem.ExceptionTotemConexionBD(
                    RecursoGeneralDAO.Codigo_Error_BaseDatos,
                    RecursoGeneralDAO.Mensaje_Error_BaseDatos,
                    ex);
            }
            catch (ExcepcionesTotem.ExceptionTotemConexionBD ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw ex;
            }
            catch (Exception ex)
            {
                Logger.EscribirError(Convert.ToString(this.GetType()),
                    ex);

                throw new ExceptionTotem(RecursoBDModulo2.CodigoExcepcionGeneral,
                    RecursoBDModulo2.MensajeExcepcionGeneral,
                    ex);
            }
            #endregion
        }
        /// <summary>
        /// metodo que se encarga del evento del boton para agregar un cliente
        /// </summary>
        /// <returns></returns>
        public bool agregarCliente()
        {
            List<String> alfabeticos = new List<String>();
            List<String> alfanumericos = new List<String>();
            List<String> numericos = new List<String>();
            List<String> correo = new List<String>();

            alfabeticos.Add(vista.apellidoNatural);
            alfabeticos.Add(vista.nombreNatural);

            correo.Add(vista.correoCliente);
            alfanumericos.Add(vista.direccionCliente);

            numericos.Add(vista.cedulaNatural);
            numericos.Add(vista.codigoPostalCliente);
            numericos.Add(vista.codTelefono);
            numericos.Add(vista.telefonoCliente);
            Regex expresion = new Regex(@"[0-9]{1,9}(\.[0-9]{0,2})?$");
            Regex expresion2 = new Regex(@"\d{1,5}\s\w.\s(\b\w*\b\s){1,2}\w*\.");
            Regex expresion3 = new Regex(@"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z");

            if (Validaciones.ValidarCamposVacios(alfabeticos) && Validaciones.ValidarCamposVacios(alfabeticos) &&
                Validaciones.ValidarCamposVacios(numericos) && Validaciones.ValidarCamposVacios(correo))
            {
                if (Validaciones.ValidarCaracteresAlfabeticos(alfabeticos))
                {
                    if (Validaciones.ValidarExpresionRegular(correo, expresion3))
                    {
                        if (Validaciones.ValidarExpresionRegular(numericos, expresion))
                        {
                            FabricaEntidades fabrica = new FabricaEntidades();

                            try
                            {
                                Entidad laDireccion = fabrica.ObtenerDireccion(vista.comboPais.SelectedValue,
                                    vista.comboEstado.SelectedValue, vista.comboCiudad.SelectedValue,
                                    vista.direccionCliente, vista.codigoPostalCliente);
                                Entidad elTelefono = fabrica.ObtenerTelefono(vista.codTelefono, vista.telefonoCliente);
                                Entidad elCliente = fabrica.ObtenerClienteNatural(vista.nombreNatural,
                                    vista.apellidoNatural, vista.correoCliente, laDireccion, elTelefono,
                                    vista.cedulaNatural);
                                Comando<Entidad, bool> comando = FabricaComandos.CrearComandoAgregarClienteNatural();
                                if (comando.Ejecutar(elCliente))
                                    HttpContext.Current.Response.Redirect(RecursoInterfazM2.ListarClientes +
                                        RecursoInterfazM2.Codigo_Exito_Agregar);
                                return true;
                            }
                            catch (Exception ex)
                            {
                                vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                                vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                                vista.alerta = RecursoInterfazM2.Alerta_Html +
                                    ex.Message +
                                    RecursoInterfazM2.Alerta_Html_Final;
                                return false;
                            }
                        }
                        else
                        {
                            vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                            vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                            vista.alerta = RecursoInterfazM2.Alerta_Html +
                                RecursoInterfazM2.Alerta_Error_Numericos +
                            RecursoInterfazM2.Alerta_Html_Final;
                            return false;
                        }
                    }
                    else
                    {
                        vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                        vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                        vista.alerta = RecursoInterfazM2.Alerta_Html +
                            RecursoInterfazM2.Alerta_Error_Correo +
                        RecursoInterfazM2.Alerta_Html_Final;
                        return false;
                    }
                }
                else
                {
                    vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                    vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                    vista.alerta = RecursoInterfazM2.Alerta_Html +
                        RecursoInterfazM2.Alerta_Error_Alfabeticos +
                    RecursoInterfazM2.Alerta_Html_Final;
                    return false;
                }
            }
            else
            {
                vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                vista.alerta = RecursoInterfazM2.Alerta_Html +
                    RecursoInterfazM2.Alerta_Error_CamposVacios +
                RecursoInterfazM2.Alerta_Html_Final;
                return false;
            }
        }
        /// <summary>
        /// metodo para modificar al cliente juridico
        /// </summary>
        /// <param name="elID">id del cliente juridico</param>
        /// <returns>booleano que refleja el exito de la operacion</returns>
        public bool modificarEmpresa(String elID)
        {
            List<String> alfabeticos = new List<String>();
            List<String> alfanumericos = new List<String>();
            List<String> numericos = new List<String>();

            alfabeticos.Add(vista.nombreEmpresa);
            alfanumericos.Add(vista.direccionEmpresa);
            alfanumericos.Add(vista.rifEmpresa);

            numericos.Add(vista.codigoPostalEmpresa);

            Regex expresion = new Regex(@"[0-9]{1,9}(\.[0-9]{0,2})?$");

            if (Validaciones.ValidarCamposVacios(alfabeticos) && Validaciones.ValidarCamposVacios(alfanumericos) &&
                Validaciones.ValidarCamposVacios(numericos))
            {
                if (Validaciones.ValidarCaracteresAlfabeticos(alfabeticos))
                {
                    if (Validaciones.ValidarExpresionRegular(numericos, expresion))
                    {
                        FabricaEntidades fabrica = new FabricaEntidades();

                        try
                        {
                            Entidad laDireccion = fabrica.ObtenerDireccion(vista.comboPais.SelectedValue,
                            vista.comboEstado.SelectedValue, vista.comboCiudad.SelectedValue,
                            vista.direccionEmpresa, vista.codigoPostalEmpresa);

                            ClienteJuridico laEmpresa = (ClienteJuridico) fabrica.ObtenerClienteJuridico();
                            laEmpresa.Id = int.Parse(elID);

                            laEmpresa.Jur_Direccion = new Direccion();
                            laEmpresa.Jur_Direccion = (Direccion)laDireccion;
                            laEmpresa.Jur_Nombre = vista.nombreEmpresa;
                            laEmpresa.Jur_Logo = "aquivaellogo";
                            laEmpresa.Jur_Rif = vista.rifEmpresa;
                            Comando<Entidad, bool> comando = FabricaComandos.CrearComandoModificarClienteJuridico();

                            if (comando.Ejecutar(laEmpresa))
                                HttpContext.Current.Response.Redirect(RecursoInterfazM2.ListarEmpresas +
                                    RecursoInterfazM2.Codigo_Exito_Modificar);
                            return true;
                        }
                        catch (Exception ex)
                        {
                            vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                            vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                            vista.alerta = RecursoInterfazM2.Alerta_Html +
                                ex.Message +
                                RecursoInterfazM2.Alerta_Html_Final;
                            return false;
                        }
                    }
                    else
                    {
                        vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                        vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                        vista.alerta = RecursoInterfazM2.Alerta_Html +
                            RecursoInterfazM2.Alerta_Error_Numericos +
                        RecursoInterfazM2.Alerta_Html_Final;
                        return false;
                    }
                }
                else
                {
                    vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                    vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                    vista.alerta = RecursoInterfazM2.Alerta_Html +
                        RecursoInterfazM2.Alerta_Error_Alfabeticos +
                    RecursoInterfazM2.Alerta_Html_Final;
                    return false;

                }
            }
            else
            {
                vista.alertaClase = RecursoInterfazM2.Alerta_Clase_Error;
                vista.alertaRol = RecursoInterfazM2.Alerta_Rol;
                vista.alerta = RecursoInterfazM2.Alerta_Html +
                    RecursoInterfazM2.Alerta_Error_CamposVacios +
                RecursoInterfazM2.Alerta_Html_Final;
                return false;
            }
        }