Exemplo n.º 1
0
        protected void SalvarClick(object sender, EventArgs e)
        {
            try
            {
                Regras.Dto.DtoEsportes esporte = new Regras.Dto.DtoEsportes();

                if (!String.IsNullOrWhiteSpace(TextId.Text))
                {
                    esporte.IdEsportes = int.Parse(TextId.Text);
                }
                esporte.NomeEsportes = TextNomeEsporte.Text;

                Regras.Regras set = new Regras.Regras();
                set.SetEsporte(esporte);

                AlertVisibleTrue();
                AlertSucesso();
                CarregarEsportes();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 2
0
        public void ConsultarClick(object sender, EventArgs e)
        {
            Regras.Regras consulta = new Regras.Regras();
            List <Regras.Dto.DtoFiliado> filiados = (List <Regras.Dto.DtoFiliado>)Session["Filiados"];

            if (!string.IsNullOrWhiteSpace(TextConsulta.Text))
            {
                filiados = filiados.Where(x => x.NomeFiliado.Contains(TextConsulta.Text.ToUpper())).ToList();
            }
            if (RBListOrdem.SelectedValue == "0")
            {
                filiados = filiados.OrderBy(x => x.NomeFiliado).ToList();
            }
            if (RBListOrdem.SelectedValue == "1")
            {
                filiados = filiados.OrderBy(x => x.NumeroRegistro).ToList();
            }
            if (RBListOrdem.SelectedValue == "2")
            {
                filiados = filiados.OrderBy(x => x.IdAssociacao).ToList();
            }
            if (RBListStatus.SelectedValue == "A")
            {
                filiados = filiados.Where(x => x.StatusFiliado == "A").ToList();
            }
            if (RBListStatus.SelectedValue == "I")
            {
                filiados = filiados.Where(x => x.StatusFiliado == "I").ToList();
            }

            Session["Filiados"]    = filiados;
            GridFiliado.DataSource = Session["Filiados"];
            GridFiliado.DataBind();
        }
Exemplo n.º 3
0
        protected void SalvarClick(object sender, EventArgs e)
        {
            try
            {
                Regras.Dto.DtoAcademia academia = new Regras.Dto.DtoAcademia();
                if (!String.IsNullOrWhiteSpace(TextIdAssocicao.Text))
                {
                    academia.IdAcademia = int.Parse(TextIdAssocicao.Text);
                }
                academia.NomeAcademia            = TextNomeAssociacao.Text.ToUpper();
                academia.EnderecoAcademia        = TextEndereco.Text.ToUpper();
                academia.ResponsavelAcademia     = TextResponsavel.Text.ToUpper();
                academia.TelefoneCelularAcademia = TextTelefoneCelular.Text;
                academia.TelefoneFixoAcademia    = TextTelefone.Text;
                academia.CnpjAcademia            = TextCnpj.Text;
                academia.InscriAcademia          = TextInscri.Text;
                academia.EmailAcademia           = TextEmail.Text.ToUpper();
                academia.IdCidadeAcademia        = int.Parse(DropDownListCidade.SelectedValue);
                academia.CepAcademia             = TextCep.Text;
                academia.IdEsporte = int.Parse(DropDownListEsporte.SelectedValue);
                academia.Sigla     = TextSigla.Text.ToUpper();


                Regras.Regras set = new Regras.Regras();
                set.SetAcademia(academia);
                CarregarAcademia();
                AlertVisibleTrue();
                AlertSucesso();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
        private void PreencheCabecalho()
        {
            Regras.Regras get        = new Regras.Regras();
            DtoCompeticao competicao = get.GetCompeticaoPorId(int.Parse(Session["idcompeticao"].ToString()));

            Label1.Text = string.Format("<b> {1} - Cidade.: {2} </b>", competicao.IdCompeticao, competicao.NomeCompeticao, competicao.NomeCidade);
        }
Exemplo n.º 5
0
        private void CarregarAssociacao()
        {
            Regras.Regras dados = new Regras.Regras();
            bool          adm   = bool.Parse(Session["Administrador"].ToString());

            List <Regras.Dto.DtoAcademia> listassociacao = new List <DtoAcademia>();

            listassociacao = dados.GetAllAcademia();
            if (!adm)
            {
                int IdAssociacao = int.Parse(Session["IdAssociacao"].ToString());
                listassociacao = listassociacao.Where(p => p.IdAcademia == IdAssociacao).ToList();
                DropDownListAssociacao.DataSource     = listassociacao;
                DropDownListAssociacao.DataTextField  = "NomeAcademia";
                DropDownListAssociacao.DataValueField = "IdAcademia";
                DropDownListAssociacao.DataBind();
            }
            else
            {
                DropDownListAssociacao.DataSource     = listassociacao;
                DropDownListAssociacao.DataTextField  = "NomeAcademia";
                DropDownListAssociacao.DataValueField = "IdAcademia";
                DropDownListAssociacao.DataBind();
                DropDownListAssociacao.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Selecione-", "0"));
            }
        }
        private void EnviaEmail(string url, string idCompeticao)
        {
            try
            {
                Regras.Regras get = new Regras.Regras();

                List <DtoAcademia>        associacao  = get.GetAllAcademiaParticipante(int.Parse(idCompeticao));
                DtoCompeticao             competicao  = get.GetCompeticaoPorId(int.Parse(idCompeticao.ToString()));
                DtoCategoriasCompeticao   categoria   = get.GetCategoriasPorIdCategoriaIdCompeticao(StaticIdCategoria, int.Parse(idCompeticao.ToString()));
                List <DtoCategoriaAtleta> listAtletas = get.GetAllAtletasPorCategoria(categoria.IdCategoriaCompeticao.ToString(), idCompeticao.ToString());
                string msg     = string.Empty;
                string assunto = "Inscritos por Categoria " + categoria.NomeCategoria;
                msg  = "SysKiai - Listagem para Conferência de Categorias " + competicao.NomeCompeticao + "<br><br>";
                msg += "<br>";
                msg += categoria.NomeCategoria + "<br>";
                foreach (var li in listAtletas)
                {
                    msg += li.NomeFiliado + " <br> ";
                }
                byte[] bytes = null;
                if (listAtletas.Count() > 0)
                {
                    Regras.Email envia = new Regras.Email();
                    envia.EnviaEmail("*****@*****.**", "*****@*****.**", "*****@*****.**", msg, assunto, bytes, true);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 7
0
        protected void btnSelecionaClick(object sender, EventArgs e)
        {
            try
            {
                MenuItem mnuItem = Menu1.FindItem("3");
                mnuItem.Enabled = true;
                Menu1.Items[MultiView1.ActiveViewIndex = 3].Selected = true;

                Regras.Regras get = new Regras.Regras();
                if (Session["IdCompeticao"] != null)
                {
                    DtoCompeticao dados = get.GetCompeticaoPorId(int.Parse(Session["IdCompeticao"].ToString()));

                    if (dados.PermiteNaoFiliado == false)
                    {
                        if (!string.IsNullOrWhiteSpace(ListAtletasCadastrados.SelectedValue))
                        {
                            TextNumeroRegistro.Text = ListAtletasCadastrados.SelectedValue;
                            BuscaFiliadoPorRegistro(sender, e);
                        }
                    }
                    else
                    {
                        TextIdAtleta.Text = ListAtletasCadastrados.SelectedValue;
                        BuscaFiliadoPorId(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 8
0
 private void SetInscricao()
 {
     try
     {
         Regras.Regras set   = new Regras.Regras();
         DtoInscricao  dados = new DtoInscricao();
         if (Session["IdInscricao"] != null)
         {
             string idinscricao = Session["IdInscricao"].ToString();
             dados.IdInscricao = int.Parse(idinscricao);
         }
         dados.IdAssociacao     = int.Parse(TextIdAssociacao.Text);
         dados.DataInscricao    = DateTime.Parse(TextData.Text);
         dados.IdLogin          = int.Parse(Session["IdUser"].ToString());
         dados.StatusInscricao  = bool.Parse(RBtnListStatus.SelectedValue);
         dados.IdCompeticao     = int.Parse(Session["IdCompeticao"].ToString());
         dados.IdEsporte        = int.Parse(Session["IdEsporte"].ToString());
         Session["IdInscricao"] = set.SetInscricao(dados);
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
         //FailureText.Text = string.Format("Erro ao inserir inscrição para a associação.{0}", ex.Message);
     }
 }
Exemplo n.º 9
0
 public void GridGraduacaoCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         int    index       = Convert.ToInt32(e.CommandArgument);
         string idGraduacao = GridGraduacao.DataKeys[index]["IdGraduacao"].ToString();
         if (e.CommandName == "Excluir")
         {
             Regras.Regras del = new Regras.Regras();
             del.DelGraduacao(idGraduacao);
         }
         else if (e.CommandName == "Editar")
         {
             Regras.Regras           get   = new Regras.Regras();
             Regras.Dto.DtoGraduacao dados = get.GetGraduacaoPorId(int.Parse(idGraduacao));
             CarregarTela(dados);
         }
         CarregarGrid();
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 10
0
        private void CarregarGrid()
        {
            Regras.Regras      get  = new Regras.Regras();
            List <DtoMensagem> list = get.GetMensagemTodosList();

            GridViewMensagem.DataSource = list;
            GridViewMensagem.DataBind();

            List <DtoImg> listImg    = get.GetImagem();
            List <DtoImg> listImgUrl = new List <DtoImg>();

            foreach (var i in listImg)
            {
                DtoImg DtoImg = new DtoImg();
                if (i.Imagem != null)
                {
                    byte[] bytes        = i.Imagem;
                    string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
                    DtoImg.Url      = "data:image/png;base64," + base64String;
                    DtoImg.Id       = i.Id;
                    DtoImg.Mensagem = i.Mensagem;
                    listImgUrl.Add(DtoImg);
                }
            }

            GridViewImg.DataSource = listImgUrl;
            GridViewImg.DataBind();
        }
 protected void GridCategoriaOnRowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (!String.IsNullOrWhiteSpace(e.CommandArgument.ToString()))
         {
             int    index       = Convert.ToInt32(e.CommandArgument);
             string idCategoria = GridCategoria.DataKeys[index]["IdCategoria"].ToString();
             StaticIdCategoria = int.Parse(idCategoria.ToString());
             string            idCompeticao = DropDownListCompeticao.SelectedValue;
             Regras.Regras     set          = new Regras.Regras();
             List <DtoSorteio> ListaSorteio = new List <DtoSorteio>();
             switch (e.CommandName)
             {
             case "FinalizaCategoria":
                 set.SetFinalizaCategoriaCompeticao(idCategoria, idCompeticao);
                 CarregarCategoriasCompeticao(idCompeticao);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 12
0
        private void ControleListBox()
        {
            CarregarCategorias();

            Regras.Regras get          = new Regras.Regras();
            string        idcompeticao = Session["IdCompeticao"].ToString();

            if (!String.IsNullOrWhiteSpace(idcompeticao))
            {
                List <Regras.Dto.DtoCategoriasCompeticao> list = get.GetCompeticaoCategorias(idcompeticao);

                List <ListItem> itemsToRemove = new List <ListItem>();

                foreach (var lst in list)
                {
                    foreach (ListItem l in ListBoxCategoriasDisponiveis.Items)
                    {
                        if (lst.IdCategoria == long.Parse(l.Value))
                        {
                            itemsToRemove.Add(l);
                        }
                    }
                }
                foreach (ListItem listIem in itemsToRemove)
                {
                    ListBoxCategoriasDisponiveis.Items.Remove(listIem);
                }

                ListBoxCategoriasLiberadas.DataSource     = list;
                ListBoxCategoriasLiberadas.DataTextField  = "NomeCategoria";
                ListBoxCategoriasLiberadas.DataValueField = "IdCategoria";
                ListBoxCategoriasLiberadas.DataBind();
            }
        }
Exemplo n.º 13
0
        public void AdicionaClick(object sender, EventArgs e)
        {
            try
            {
                if (ListBoxCategoriasDisponiveis.Items.Count != 0)
                {
                    ListBoxCategoriasLiberadas.Items.Add(ListBoxCategoriasDisponiveis.SelectedItem);

                    Regras.Dto.DtoCategoriasCompeticao dados = new DtoCategoriasCompeticao();
                    dados.IdCategoria          = long.Parse(ListBoxCategoriasDisponiveis.SelectedValue);
                    dados.IdCompeticao         = long.Parse(Session["idCompeticao"].ToString());
                    dados.IdEsporte            = long.Parse(DropDownListEsporte.SelectedValue);
                    dados.Categoria_Finalizada = false;
                    Regras.Regras set = new Regras.Regras();
                    set.SetCategoriaCompeticao(dados);

                    ListBoxCategoriasDisponiveis.Items.RemoveAt(ListBoxCategoriasDisponiveis.SelectedIndex);
                }
                else
                {
                    throw new Exception("Selecione ao menos uma categoria");
                }
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 14
0
        public void AdicionaTodosClick(object sender, EventArgs e)
        {
            try
            {
                foreach (ListItem lst in ListBoxCategoriasDisponiveis.Items)
                {
                    lst.Selected = true;
                    ListBoxCategoriasLiberadas.Items.Add(lst);
                    lst.Selected = false;

                    Regras.Dto.DtoCategoriasCompeticao dados = new DtoCategoriasCompeticao();
                    dados.IdCategoria          = long.Parse(lst.Value);
                    dados.IdCompeticao         = long.Parse(Session["idCompeticao"].ToString());
                    dados.IdEsporte            = long.Parse(DropDownListEsporte.SelectedValue);
                    dados.Categoria_Finalizada = false;
                    Regras.Regras set = new Regras.Regras();
                    set.SetCategoriaCompeticao(dados);
                }
                ListBoxCategoriasDisponiveis.Items.Clear();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 15
0
        public void GridRankingCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                int    index     = Convert.ToInt32(e.CommandArgument);
                string idRanking = GridRanking.DataKeys[index]["IdRanking"].ToString();
                //Session["IdFiliado"] = idFiliado;
                if (e.CommandName == "Excluir")
                {
                    Regras.Regras del = new Regras.Regras();
                    del.DelRanking(idRanking);
                }
                else if (e.CommandName == "Editar")
                {
                    Regras.Regras         get   = new Regras.Regras();
                    Regras.Dto.DtoRanking dados = get.GetRankingPorId(int.Parse(idRanking));
                    CarregarAcademia();
                    PreencheTela(dados);
                }

                AlertVisibleTrue();
                AlertSucesso();
                CarregarRanking();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 16
0
 public void GridViewCompeticoesCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         int n = 0;
         if (int.TryParse(e.CommandArgument.ToString(), out n))
         {
             int    index        = Convert.ToInt32(e.CommandArgument);
             string idCompeticao = GridViewCompeticoes.DataKeys[index]["IdCompeticao"].ToString();
             Session["IdCompeticao"] = idCompeticao;
             if (e.CommandName == "Excluir")
             {
                 Regras.Regras del = new Regras.Regras();
                 del.DelCompeticao(idCompeticao);
             }
             else if (e.CommandName == "Editar")
             {
                 Regras.Regras            get   = new Regras.Regras();
                 Regras.Dto.DtoCompeticao dados = get.GetCompeticaoPorId(int.Parse(idCompeticao));
                 LimpaTela();
                 CarregaTela(dados);
                 ControleListBox();
                 Menu1.Items[MultiView1.ActiveViewIndex = 0].Selected = true;
             }
             CarregarGrid();
         }
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 17
0
 public void GridCategoriaCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         CarregarGraduacao();
         int n = 0;
         if (int.TryParse(e.CommandArgument.ToString(), out n))
         {
             int    index       = Convert.ToInt32(e.CommandArgument);
             string idCategoria = GridCategoria.DataKeys[index]["IdCategoria"].ToString();
             if (e.CommandName == "Excluir")
             {
                 Regras.Regras del = new Regras.Regras();
                 del.DelCategoria(idCategoria);
             }
             else if (e.CommandName == "Editar")
             {
                 Regras.Regras           get   = new Regras.Regras();
                 Regras.Dto.DtoCategoria dados = get.GetCategoriaPorId(int.Parse(idCategoria));
                 CarregaTela(dados);
                 CarregarGraduacao();
                 CarregarTpCompeticao();
             }
             CarregarGrid();
         }
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 18
0
 public void GridLoginCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         int n = 0;
         if (int.TryParse(e.CommandArgument.ToString(), out n))
         {
             int    index    = Convert.ToInt32(e.CommandArgument);
             string idAcesso = GridViewLogin.DataKeys[index]["IdAcesso"].ToString();
             Session["idLogin"] = idAcesso;
             if (e.CommandName == "Excluir")
             {
                 Regras.Regras del = new Regras.Regras();
                 del.DelLoginAcesso(idAcesso);
             }
             else if (e.CommandName == "Editar")
             {
                 Regras.Regras        get   = new Regras.Regras();
                 Regras.Dto.DtoAcesso dados = get.GetLoginPorId(int.Parse(idAcesso));
                 CarregaTela(dados);
             }
             CarregarGrid();
         }
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 19
0
        private void ControleListBox(DtoAcesso dados)
        {
            CarregarAllTelas();

            Regras.Regras get = new Regras.Regras();
            List <Regras.Dto.DtoLoginTela> listaTelasLiberadas = get.GetTelasLiberadasPorIdLogin(dados.IdAcesso);
            List <ListItem> itemsToRemove = new List <ListItem>();

            foreach (var lst in listaTelasLiberadas)
            {
                foreach (ListItem l in ListBoxTelasDisponiveis.Items)
                {
                    if (lst.IdTela == long.Parse(l.Value))
                    {
                        itemsToRemove.Add(l);
                    }
                }
            }
            foreach (ListItem listIem in itemsToRemove)
            {
                ListBoxTelasDisponiveis.Items.Remove(listIem);
            }
            ListBoxTelasLiberadas.DataSource     = listaTelasLiberadas;
            ListBoxTelasLiberadas.DataTextField  = "NomeTela";
            ListBoxTelasLiberadas.DataValueField = "IdTela";
            ListBoxTelasLiberadas.DataBind();
        }
Exemplo n.º 20
0
 public void SalvarClick(object sender, EventArgs e)
 {
     try
     {
         Regras.Dto.DtoAcesso dados = new Regras.Dto.DtoAcesso();
         if (!String.IsNullOrWhiteSpace(TextIdAcesso.Text))
         {
             dados.IdAcesso = int.Parse(TextIdAcesso.Text);
         }
         dados.Nome          = TextNome.Text;
         dados.Login         = TextLogin.Text;
         dados.Senha         = TextSenha.Text;
         dados.Administrador = CheckBoxAdm.Checked;
         dados.StatusLogin   = CheckBoxStatus.Checked;
         dados.IdAssociacao  = int.Parse(DropDownListAssociacao.SelectedValue);
         Regras.Regras set     = new Regras.Regras();
         long          idLogin = set.SetAcesso(dados);
         Session["idLogin"] = idLogin;
         AlertVisibleTrue();
         AlertSucesso();
         CarregarGrid();
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
Exemplo n.º 21
0
        protected void BtnSalvarClick(object sender, EventArgs e)
        {
            try
            {
                Regras.Regras set   = new Regras.Regras();
                DtoMensagem   dados = new DtoMensagem();

                if (!string.IsNullOrWhiteSpace(Textid.Text))
                {
                    dados.Id = int.Parse(Textid.Text);
                }
                String s = TextArea1.Value;
                if (s.Length > 500)
                {
                    throw new Exception("Quantidade de caractéres deve ser menor que 500");
                }
                dados.Mensagem   = s;
                dados.Finalidade = RbListFinalidade.SelectedValue;
                dados.DataLimite = DateTime.Parse(TextDataFinal.Text);
                set.SetMensagem(dados);
                AlertVisibleTrue();
                AlertSucesso();
                CarregarGrid();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
        protected void GridFiliadoDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string idFiliado = (string)this.GridFiliado.DataKeys[e.Row.RowIndex]["IdFiliado"].ToString();
                Session["IdFiliado"] = idFiliado;

                Regras.Regras         get   = new Regras.Regras();
                Regras.Dto.DtoFiliado dados = get.GetFiliadoPorId(int.Parse(idFiliado));

                if (dados != null)
                {
                    if (dados.StatusFiliado.Equals("A"))
                    {
                        ((ImageButton)e.Row.Cells[8].Controls[0]).ImageUrl      = "~/Imagens/lock.png";
                        ((ImageButton)e.Row.Cells[8].Controls[0]).AlternateText = "Bloquear";
                        ((ImageButton)e.Row.Cells[8].Controls[0]).CommandName   = "Bloquear";
                    }
                    else
                    {
                        ((ImageButton)e.Row.Cells[8].Controls[0]).ImageUrl      = "~/Imagens/Unlock.png";
                        ((ImageButton)e.Row.Cells[8].Controls[0]).AlternateText = "Liberar";
                        ((ImageButton)e.Row.Cells[8].Controls[0]).CommandName   = "Liberar";
                    }
                }
            }
        }
Exemplo n.º 23
0
        protected void SalvarClick(object sender, EventArgs e)
        {
            try
            {
                Regras.Dto.DtoCidade cidade = new Regras.Dto.DtoCidade();
                if (!String.IsNullOrWhiteSpace(TextIdCidade.Text))
                {
                    cidade.IdCidade = int.Parse(TextIdCidade.Text);
                }
                cidade.NomeCidade = TextNomeCidade.Text.ToUpper();
                cidade.CepCidade  = TextCep.Text;
                cidade.IdEstado   = int.Parse(DropDownListEstado.SelectedValue);

                Regras.Regras set = new Regras.Regras();
                set.SetCidade(cidade);

                AlertVisibleTrue();
                AlertSucesso();
                CarregarGrid();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 24
0
 protected void GridMensagemCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         int    index      = Convert.ToInt32(e.CommandArgument);
         string idMensagem = GridViewMensagem.DataKeys[index]["Id"].ToString();
         if (e.CommandName == "Excluir")
         {
             Regras.Regras del = new Regras.Regras();
             del.DelMesnsagem(idMensagem);
         }
         else if (e.CommandName == "Editar")
         {
             Regras.Regras          get   = new Regras.Regras();
             Regras.Dto.DtoMensagem dados = get.GetMensagemPorId(int.Parse(idMensagem));
             CarregaTela(dados);
         }
         CarregarGrid();
     }
     catch (Exception ex)
     {
         AlertVisibleTrue();
         AlertError(ex.Message);
     }
 }
        private void AndamentoCompeticao(string idCompeticao)
        {
            Regras.Regras get = new Regras.Regras();

            List <DtoCategoriasCompeticao> categorias = get.GetAllCategoriaPorCompeticao(idCompeticao);
            int countCategorias = categorias.Count();
            List <DtoCategoriasCompeticao> CategoriasCompeticaoFinalizada = get.GetAllPorCategoriaFinalizadas(idCompeticao);
            int countCategoriasFinalizadas = CategoriasCompeticaoFinalizada.Count();
            List <DtoGraficoAndamentoCompeticao> listcount = new List <DtoGraficoAndamentoCompeticao>();
            bool first = true;

            for (int i = 0; i < 2; i++)
            {
                DtoGraficoAndamentoCompeticao count = new DtoGraficoAndamentoCompeticao();
                if (first)
                {
                    count.Nome  = "Total de Categoras ";
                    count.Count = countCategorias;
                    first       = false;
                }
                else
                {
                    count.Nome  = "Categorias Finalizadas ";
                    count.Count = countCategoriasFinalizadas;
                }
                listcount.Add(count);
            }
            GraficoAndamentoCompeticao.DataSource = listcount;
            GraficoAndamentoCompeticao.DataBind();
        }
Exemplo n.º 26
0
        protected void GridEstadoCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                int    index    = Convert.ToInt32(e.CommandArgument);
                string idEstado = GridViewEstado.DataKeys[index]["IdEstado"].ToString();

                if (e.CommandName == "Excluir")
                {
                    Regras.Regras del = new Regras.Regras();
                    del.DelEstado(idEstado);
                }
                else if (e.CommandName == "Editar")
                {
                    Regras.Regras        get   = new Regras.Regras();
                    Regras.Dto.DtoEstado dados = get.GetEstadoPorId(int.Parse(idEstado));
                    CarregarTela(dados);
                }
                CarregarGrid();
            }
            catch (Exception ex)
            {
                FailureText.Text = ex.Message;
            }
        }
Exemplo n.º 27
0
        public void AdicionaClick(object sender, EventArgs e)
        {
            try
            {
                if (ListBoxTelasDisponiveis.Items.Count != 0)
                {
                    ListBoxTelasLiberadas.Items.Add(ListBoxTelasDisponiveis.SelectedItem);
                    ListBoxTelasDisponiveis.Items.RemoveAt(ListBoxTelasDisponiveis.SelectedIndex);

                    foreach (ListItem lst in ListBoxTelasLiberadas.Items)
                    {
                        Regras.Dto.DtoLoginTela dados = new DtoLoginTela();
                        dados.IdLogin = long.Parse(Session["idLogin"].ToString());
                        dados.IdTela  = long.Parse(lst.Value);
                        Regras.Regras set = new Regras.Regras();
                        set.SetLoginTelas(dados);
                    }
                }
                else
                {
                    throw new Exception("Selecione ao menos uma tela");
                }
                ListBoxTelasLiberadas.ClearSelection();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 28
0
        public void SalvarClick(object sender, EventArgs e)
        {
            try
            {
                Regras.Dto.DtoCategoria item = new Regras.Dto.DtoCategoria();
                if (!String.IsNullOrWhiteSpace(TextId.Text))
                {
                    item.IdCategoria = int.Parse(TextId.Text);
                }
                item.IdEsporte          = int.Parse(DropDownListEsporte.SelectedValue);
                item.IdGraduacaoInicial = int.Parse(DropDownListGraduacaoInicial.SelectedValue);
                item.IdGraduacaoFinal   = int.Parse(DropDownListGraduacaoFinal.SelectedValue);
                item.DescricaoCategoria = TextDescricaoCategoria.Text;
                item.SexoCategoria      = RBtnListSexo.SelectedValue;
                item.TpCategoria        = DropDownListTpCategoria.SelectedValue;
                item.TpCompeticao       = long.Parse(DropDownTpCompeticao.SelectedValue.ToString());
                if (!String.IsNullOrWhiteSpace(TextNumeroCategoria.Text))
                {
                    item.NumeroCategoria = int.Parse(TextNumeroCategoria.Text);
                }
                if (!String.IsNullOrWhiteSpace(TextAlturaInicial.Text))
                {
                    item.AlturaInicial = decimal.Parse(TextAlturaInicial.Text);
                }
                if (!String.IsNullOrWhiteSpace(TextAlturaFinal.Text))
                {
                    item.AlturaFinal = decimal.Parse(TextAlturaFinal.Text);
                }
                if (!String.IsNullOrWhiteSpace(TextPesoInicial.Text))
                {
                    item.PesoInicial = decimal.Parse(TextPesoInicial.Text);
                }
                if (!String.IsNullOrWhiteSpace(TextPesoFinal.Text))
                {
                    item.PesoFinal = decimal.Parse(TextPesoFinal.Text);
                }
                item.StatusCategoria = CheckStatus.Checked;
                if (!String.IsNullOrWhiteSpace(TextIdadeInicial.Text))
                {
                    item.IdadeInicial = int.Parse(TextIdadeInicial.Text);
                }
                if (!String.IsNullOrWhiteSpace(TextIdadeFinal.Text))
                {
                    item.IdadeFinal = int.Parse(TextIdadeFinal.Text);
                }

                Regras.Regras set = new Regras.Regras();
                set.SetCategoria(item);
                CarregarGrid();

                AlertVisibleTrue();
                AlertSucesso();
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Exemplo n.º 29
0
        private void CarregarGrid()
        {
            Regras.Regras get = new Regras.Regras();
            List <Regras.Dto.DtoEstado> dados = get.GetAllEstado();

            GridViewEstado.DataSource = dados;
            GridViewEstado.DataBind();
        }
Exemplo n.º 30
0
        private void CarregarGrid()
        {
            Regras.Regras get = new Regras.Regras();
            List <Regras.Dto.DtoCompeticao> list = get.GetAllCompeticao();

            GridViewCompeticoes.DataSource = list;
            GridViewCompeticoes.DataBind();
        }