示例#1
0
    private DataTable GerarRelatorio()
    {
        string sDataInicial       = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(txtdatDataInicial.Text);
        string sDataFinal         = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(txtdatDataFinal.Text) + " 23:59:59";
        int    iIDUsuario         = Convert.ToInt32(dropOperador.SelectedValue);
        int    iIDCampanha        = Convert.ToInt32(dropCampanha.SelectedValue);
        int    iIDMailing         = Convert.ToInt32(dropMailing.SelectedValue);
        int    iIDTipoAtendimento = -1;

        string sIDStatus = "";

        foreach (ListItem listItem in chkStatus.Items)
        {
            if (listItem.Selected)
            {
                sIDStatus += sIDStatus != "" ? ", " + listItem.Value : listItem.Value;
            }
        }

        relatorioCTL CRelatorio = new relatorioCTL();
        DataTable    dataTable  = CRelatorio.RetornarContatosTrabalhadosDetalhado(sDataInicial, sDataFinal, iIDUsuario, iIDCampanha, iIDMailing, iIDTipoAtendimento, sIDStatus);

        dgDados.DataSource = dataTable;
        dgDados.DataBind();

        lblRegistros.Text = "| " + dataTable.Rows.Count.ToString() + " registro(s) |";
        return(dataTable);
    }
示例#2
0
        private void ExportarRelatorio()
        {
            try
            {
                string sHoraInicial = "";
                string sHoraFinal   = "23:59:59";

                if (comboHoraInicial.Text != "")
                {
                    sHoraInicial = comboHoraInicial.Text.ToString() + ":00";
                }
                if (comboHoraFinal.Text != "")
                {
                    sHoraFinal = comboHoraFinal.Text.ToString() + ":00";
                }

                string sDataInicial = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(datDataInicial.Value.ToString("dd/MM/yyyy")) + " " + sHoraInicial;
                string sDataFinal   = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(datDataFinal.Value.ToString("dd/MM/yyyy")) + " " + sHoraFinal;
                int    iIDUsuario   = Convert.ToInt32(comboOperador.SelectedValue);

                int iIDTipoAtendimento = -1;
                if (radAtivo.Checked == true)
                {
                    iIDTipoAtendimento = 1;
                }
                else if (radReceptivo.Checked == true)
                {
                    iIDTipoAtendimento = 2;
                }

                string sIDStatus = "";

                foreach (object itemChecked in chlStatus.CheckedItems)
                {
                    if (sIDStatus != "")
                    {
                        sIDStatus += ", ";
                    }

                    sIDStatus += itemChecked.ToString().Substring(0, 1) != "-" ? itemChecked.ToString().Substring(0, itemChecked.ToString().IndexOf("-") - 1) : itemChecked.ToString().Substring(0, itemChecked.ToString().IndexOf("-", 1) - 1);
                }

                string      sCampanha    = "";
                campanhaCTL CCampanha    = new campanhaCTL();//r
                string      sIDCampanhas = "";
                foreach (object itemChecked in chkCampanha.CheckedItems)
                {
                    if (sIDCampanhas != "")
                    {
                        sIDCampanhas = sIDCampanhas + ",";
                    }

                    sIDCampanhas = sIDCampanhas + CCampanha.RetornarIDCampanha(itemChecked.ToString());

                    if (sCampanha != "")
                    {
                        sCampanha = sCampanha + "; ";
                    }

                    sCampanha = sCampanha + itemChecked.ToString();
                }

                string     sMailing   = "";
                mailingCTL CMailing   = new mailingCTL();
                string     sIDMailing = "";
                foreach (object itemChecked in chkMailing.CheckedItems)
                {
                    if (sIDMailing != "")
                    {
                        sIDMailing = sIDMailing + ",";
                    }

                    sIDMailing = sIDMailing + CMailing.RetornarIDMailing(itemChecked.ToString());

                    if (sMailing != "")
                    {
                        sMailing = sMailing + "; ";
                    }

                    sMailing = sMailing + itemChecked.ToString();
                }

                relatorioCTL CRelatorio = new relatorioCTL();
                DataTable    dataTable  = CRelatorio.RetornarContatosTrabalhadosDetalhado(sDataInicial, sDataFinal, iIDUsuario, sIDCampanhas, sIDMailing, iIDTipoAtendimento, sIDStatus);

                string sEnderecoArquivo = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + "Tabulare - Contatos_Trabalhados_Detalhado.xls";
                dataTable.TableName = "Tabulare";
                dataTable.WriteXml(sEnderecoArquivo);

                MessageBox.Show("Dados exportados com sucesso!\n\nO arquivo encontra-se na Área de Trabalho.", "Tabulare");
            }
            catch (Exception ex)
            {
                PontoBr.Utilidades.Diversos.ExibirAlertaWindowsForm(ex.Message, "Tabulare Software");
            }
        }
示例#3
0
        private void GerarRelatorio()
        {
            try
            {
                string sHoraInicial = "";
                string sHoraFinal   = "23:59:59";

                if (comboHoraInicial.Text != "")
                {
                    sHoraInicial = comboHoraInicial.Text.ToString() + ":00";
                }
                if (comboHoraFinal.Text != "")
                {
                    sHoraFinal = comboHoraFinal.Text.ToString() + ":00";
                }

                string sDataInicial = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(datDataInicial.Value.ToString("dd/MM/yyyy")) + " " + sHoraInicial;
                string sDataFinal   = PontoBr.Conversoes.Data.ConverterDataFormatoDDMMAAAAComBarraParaAAAAMMDDComBarra(datDataFinal.Value.ToString("dd/MM/yyyy")) + " " + sHoraFinal;
                int    iIDUsuario   = Convert.ToInt32(comboOperador.SelectedValue);

                int iIDTipoAtendimento = -1;
                if (radAtivo.Checked == true)
                {
                    iIDTipoAtendimento = 1;
                }
                else if (radReceptivo.Checked == true)
                {
                    iIDTipoAtendimento = 2;
                }

                string sIDStatus = "";

                foreach (object itemChecked in chlStatus.CheckedItems)
                {
                    if (sIDStatus != "")
                    {
                        sIDStatus += ", ";
                    }

                    sIDStatus += itemChecked.ToString().Substring(0, 1) != "-" ? itemChecked.ToString().Substring(0, itemChecked.ToString().IndexOf("-") - 1) : itemChecked.ToString().Substring(0, itemChecked.ToString().IndexOf("-", 1) - 1);
                }

                //Campanha
                string      sCampanha    = "";
                campanhaCTL CCampanha    = new campanhaCTL();//r
                string      sIDCampanhas = "";
                foreach (object itemChecked in chkCampanha.CheckedItems)
                {
                    if (sIDCampanhas != "")
                    {
                        sIDCampanhas = sIDCampanhas + ",";
                    }

                    sIDCampanhas = sIDCampanhas + CCampanha.RetornarIDCampanha(itemChecked.ToString());

                    if (sCampanha != "")
                    {
                        sCampanha = sCampanha + "; ";
                    }

                    sCampanha = sCampanha + itemChecked.ToString();
                }

                //Maling
                string     sMailing   = "";
                mailingCTL CMailing   = new mailingCTL();
                string     sIDMailing = "";
                foreach (object itemChecked in chkMailing.CheckedItems)
                {
                    if (sIDMailing != "")
                    {
                        sIDMailing = sIDMailing + ",";
                    }

                    sIDMailing = sIDMailing + CMailing.RetornarIDMailing(itemChecked.ToString());

                    if (sMailing != "")
                    {
                        sMailing = sMailing + "; ";
                    }

                    sMailing = sMailing + itemChecked.ToString();
                }

                relatorioCTL CRelatorio = new relatorioCTL();
                DataTable    dataTable  = CRelatorio.RetornarContatosTrabalhadosDetalhado(sDataInicial, sDataFinal, iIDUsuario, sIDCampanhas, sIDMailing, iIDTipoAtendimento, sIDStatus);
                dgDados.DataSource = dataTable;
            }
            catch (Exception ex)
            {
                PontoBr.Utilidades.Diversos.ExibirAlertaWindowsForm(ex.Message, "Tabulare Software");
            }
        }