示例#1
0
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            if (ValidarCampos())
            {
                RelatorioBLL      RelBLL = new RelatorioBLL();
                FUN_TBL_RELATORIO uptRel = new FUN_TBL_RELATORIO();
                Resultado         res    = new Resultado();

                uptRel.RELATORIO          = txtRelatorio.Text;
                uptRel.TITULO             = txtTitulo.Text;
                uptRel.ARQUIVO            = txtOrigem.Text;
                uptRel.ID_TIPO_RELATORIO  = short.Parse(ddlTipo.SelectedValue);
                uptRel.RELATORIO_EXTENSAO = txtExtensao.Text;

                if (!String.IsNullOrEmpty(txtCodigo.Text))
                {
                    uptRel.ID_RELATORIO = int.Parse(txtCodigo.Text);
                    res = RelBLL.UpdateData(uptRel);
                }
                else
                {
                    uptRel.ID_RELATORIO = 0;
                    res = RelBLL.InsertData(uptRel);
                }

                if (res.Ok)
                {
                    txtCodigo.Text          = uptRel.ID_RELATORIO.ToString();
                    btnInserirParam.Enabled = true;
                    grdRelatorio.DataBind();
                }

                MostraMensagem(spanMensagemDetalhe, res.Mensagem, (res.Ok) ? "n_ok" : "n_error");
            }
        }
示例#2
0
 public RelatorioUI(int portfolioId)
 {
     InitializeComponent();
     rBll                   = new RelatorioBLL(portfolioId);
     matrizCriterios        = rBll.MatrizCriterios;
     matrizAtividades       = rBll.MatrizAtividades;
     listLabelAtividades    = new List <Label>();
     listLabelCriterios     = new List <Label>();
     listLabelNotaCriterios = new List <Label>();
 }
示例#3
0
        private void CarregarDetalhesRelatorio(int CodRelatorio)
        {
            RelatorioBLL      RelBLL = new RelatorioBLL();
            FUN_TBL_RELATORIO rel    = RelBLL.ConsultarRelatorio(CodRelatorio);

            CarregaDropDowList(ddlTipo, RelBLL.GetRelatorioTipos().ToList <Object>(), "NM_TIPO", "ID_TIPO_RELATORIO");
            txtCodigo.Text        = rel.ID_RELATORIO.ToString();
            txtRelatorio.Text     = rel.RELATORIO;
            ddlTipo.SelectedValue = rel.ID_TIPO_RELATORIO.ToString();
            txtTitulo.Text        = rel.TITULO;
            txtOrigem.Text        = rel.ARQUIVO;
            txtExtensao.Text      = rel.RELATORIO_EXTENSAO;
        }
示例#4
0
        protected void btnNovo_Click(object sender, EventArgs e)
        {
            txtCodigo.Text    = "";
            txtRelatorio.Text = String.Empty;
            txtTitulo.Text    = String.Empty;
            txtOrigem.Text    = String.Empty;
            txtExtensao.Text  = String.Empty;
            RelatorioBLL RelBLL = new RelatorioBLL();

            CarregaDropDowList(ddlTipo, RelBLL.GetRelatorioTipos().ToList <Object>(), "NM_TIPO", "ID_TIPO_RELATORIO");
            pnlLista.Visible        = false;
            pnlDetalhe.Visible      = true;
            btnInserirParam.Enabled = false;
        }
示例#5
0
        private void CarregarParametrosRelatorio(int CodRelatorioParam)
        {
            RelatorioBLL            RelBLL = new RelatorioBLL();
            FUN_TBL_RELATORIO_PARAM param  = RelBLL.ConsultarParametro(CodRelatorioParam);

            //FUN_TBL_RELATORIO rel = RelBLL.ConsultarRelatorio(int.Parse(param.ID_RELATORIO.ToString()));
            //CarregaDropDowList(ddlTipoParam, RelBLL.GetParametrosTipos().ToList<Object>(), "Text", "Value");
            txtRelatorioParam.Text       = txtTitulo.Text;
            txtCodigoParam.Text          = param.ID_RELATORIO_PARAMETRO.ToString();
            txtOrdem.Text                = param.ORDEM.ToString();
            ddlStatus.SelectedValue      = param.HABILITADO;
            txtParametro.Text            = param.PARAMETRO;
            txtDescricao.Text            = param.DESCRICAO;
            ddlTipoParam.SelectedValue   = param.TIPO;
            ddlComponente.SelectedValue  = param.COMPONENTE_WEB;
            txtConsultaDropdownList.Text = param.DROPDOWLIST_CONSULTA;
            chkPermiteNulo.Checked       = (param.PERMITE_NULL == "S");
            chkVisivel.Checked           = (param.VISIVEL == "S");
        }
示例#6
0
        protected void btnParamSalvar_Click(object sender, EventArgs e)
        {
            //if (ValidarCamposParam())
            RelatorioBLL            RelBLL   = new RelatorioBLL();
            FUN_TBL_RELATORIO_PARAM uptParam = new FUN_TBL_RELATORIO_PARAM();
            Resultado res = new Resultado();

            //ID_RELATORIO_PARAMETRO
            uptParam.ID_RELATORIO         = int.Parse(txtCodigo.Text);
            uptParam.PARAMETRO            = txtParametro.Text;
            uptParam.DESCRICAO            = txtDescricao.Text;
            uptParam.TIPO                 = ddlTipoParam.SelectedValue;
            uptParam.COMPONENTE_WEB       = ddlComponente.SelectedValue;
            uptParam.DROPDOWLIST_CONSULTA = txtConsultaDropdownList.Text;
            uptParam.VALOR_INICIAL        = txtValorInicial.Text;
            uptParam.HABILITADO           = ddlStatus.SelectedValue;
            uptParam.VISIVEL              = (chkVisivel.Checked ? "S" : "N");
            uptParam.PERMITE_NULL         = (chkPermiteNulo.Checked ? "S" : "N");
            uptParam.ORDEM                = int.Parse(txtOrdem.Text);

            if (!String.IsNullOrEmpty(txtCodigoParam.Text))
            {
                uptParam.ID_RELATORIO_PARAMETRO = int.Parse(txtCodigoParam.Text);
                res = RelBLL.UpdateParam(uptParam);
            }
            else
            {
                uptParam.ID_RELATORIO_PARAMETRO = 0;
                res = RelBLL.InsertParam(uptParam);
            }

            if (res.Ok)
            {
                txtCodigoParam.Text = uptParam.ID_RELATORIO_PARAMETRO.ToString();
                grdParametro.DataBind();
                btnParamVoltar_Click(sender, e);
            }

            MostraMensagem(spanMensagemParametro, res.Mensagem, (res.Ok) ? "n_ok" : "n_error");
        }
示例#7
0
 public RelatorioController()
 {
     _bll = new RelatorioBLL();
 }
示例#8
0
 public frmRelatorio()
 {
     InitializeComponent();
     RelatorioBLL = new RelatorioBLL();
 }
示例#9
0
    protected void GeraHtml(HtmlTable table, Relatorio relatorio)
    {
        List <Parametro> parametros     = relatorio.parametros;
        string           relatorio_nome = relatorio.relatorio;

        if (parametros.Count > 0)
        {
            string tamanho = "200px";
            System.Text.StringBuilder scriptAjax = new System.Text.StringBuilder();

            foreach (var par in parametros)
            {
                HtmlTableRow row = new HtmlTableRow();

                Label label1 = new Label();
                label1.ID      = "lbl" + par.parametro;
                label1.Text    = par.descricao;
                label1.Visible = par.visivel == "S";

                HtmlTableCell cell = new HtmlTableCell();
                cell.Controls.Add(label1);;
                row.Cells.Add(cell);

                if (par.componente_web == "DropDownList")
                {
                    DropDownList DropDownList1 = new DropDownList();
                    DropDownList1.ID      = "Param_" + par.parametro;
                    DropDownList1.Visible = par.visivel == "S";
                    DropDownList1.Enabled = par.habilitado == "S";
                    DropDownList1.Style.Add("width", tamanho);

                    if (par.dropdowlist_consulta.Length > 0)
                    {
                        RelatorioBLL relBLL = new RelatorioBLL();
                        CarregaDropDowDT(relBLL.ListarDrop(par.dropdowlist_consulta), DropDownList1);
                    }

                    if (par.valor_inicial.Length > 0)
                    {
                        DropDownList1.SelectedValue = par.valor_inicial;
                    }



                    HtmlTableCell cell1 = new HtmlTableCell();
                    cell1.Controls.Add(DropDownList1);
                    row.Cells.Add(cell1);
                }

                if (par.componente_web == "TextBox")
                {
                    ///////////////CONDIÇÃO EXCLUSIVA PARA O RELATÓRIO_CONTROLE_LIBERAÇÃO_FATURA//////////////////////
                    if (relatorio_nome == "Rel_Controle_liberacao.rpt" &&
                        par.parametro.Equals("matricula"))
                    {
                        label1.Visible = false;
                        var user = (ConectaAD)Session["objUser"];

                        HiddenField hdnField = new HiddenField();
                        hdnField.ID = "Param_" + par.parametro;
                        if ((user.nome == "Wendel Lemes") || (user.nome == "Ana Claudia Alves Santos") || (user.nome == "Soraya Diba Alves de Lima"))
                        {
                            par.valor_inicial = " ";
                        }

                        else
                        {
                            par.valor_inicial = user.login;
                        }


                        if (par.valor_inicial.Length > 0)
                        {
                            hdnField.Value = (par.valor_inicial.ToUpper() == "SYSDATE") ? DateTime.Now.ToString("dd/MM/yyyy") : par.valor_inicial;
                        }

                        HtmlTableCell cell2 = new HtmlTableCell();
                        cell2.Controls.Add(hdnField);;
                        row.Cells.Add(cell2);
                    }
                    ///////////////FIM DA CONDIÇÃO EXCLUSIVA PARA O RELATÓRIO_CONTROLE_LIBERAÇÃO_FATURA//////////////////////
                    else
                    {
                        TextBox TextBox1 = new TextBox();
                        TextBox1.ID      = "Param_" + par.parametro;
                        TextBox1.Visible = par.visivel == "S";
                        TextBox1.Style.Add("width", tamanho);
                        TextBox1.Enabled = par.habilitado == "S";

                        if (par.tipo == "DateField")
                        {
                            TextBox1.CssClass = "date";
                            TextBox1.Attributes.Add("onkeypress", "javascript:return mascara(this, data);");
                            TextBox1.Attributes.Add("MaxLength", "10");
                        }
                        else if (par.tipo == "NumberField")
                        {
                            TextBox1.CssClass = "number";
                            TextBox1.Attributes.Add("onkeypress", "javascript:return mascara(this, soNumeros);");
                            TextBox1.Attributes.Add("MaxLength", "10");
                        }

                        if (par.valor_inicial.Length > 0)
                        {
                            TextBox1.Text = (par.valor_inicial.ToUpper() == "SYSDATE") ? DateTime.Now.ToString("dd/MM/yyyy") : par.valor_inicial;
                        }
                        HtmlTableCell cell2 = new HtmlTableCell();
                        cell2.Controls.Add(TextBox1);;
                        row.Cells.Add(cell2);
                    }
                }
                table.Rows.Add(row);
            }
        }
    }