/// <summary>
        /// Exclui o item corrente da lista
        /// </summary>
        /// <returns></returns>
        public override bool Excluir()
        {
            try
            {
                bool ok = musicaCabecaInscrito.Excluir();
                if (ok)
                {
                    lista.RemoveAt(Indice);
                }

                return(ok);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public object AlterarInscricao(int Evento, int clienteID)
        {
            try
            {
                string retorno = "Cancelar";

                MusicaCabecaInscrito oInscrito = new MusicaCabecaInscrito();
                oInscrito.Ler(Evento, clienteID);

                if (oInscrito.Control.ID > 0)
                {
                    oInscrito.CancelarAgregados();
                    oInscrito.Excluir();

                    retorno = "Inscrever";
                }
                else
                {
                    oInscrito.Assinante.Valor      = new IRLib.Paralela.Cliente().VerificaAssinante(clienteID);
                    oInscrito.MusicaCabecaID.Valor = Evento;
                    oInscrito.DataInscricao.Valor  = DateTime.Now;
                    oInscrito.ClienteID.Valor      = clienteID;
                    oInscrito.Inserir();
                }

                return(retorno);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                bd.Fechar();
            }
        }