Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MetodosPontoFrequencia.Frequencia Freq = new MetodosPontoFrequencia.Frequencia();

        MetodosPontoFrequencia.DataSetPontoFrequencia ds = new DataSetPontoFrequencia();

        MetodosPontoFrequencia.PreencheTabela pt = new MetodosPontoFrequencia.PreencheTabela();

        Freq.HorasDias(7, 688, 2014, ds, 4, 7);

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        Report.Load(Server.MapPath(@"~/Relatorio/RPT/ReportTesteFeito.mrt"));

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        MemoryStream memStream = new MemoryStream();

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true, "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit128, false);

        //HttpContext.Current.Response.ClearContent();
        //HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";
        HttpContext.Current.Response.BinaryWrite(memStream.ToArray());
        //HttpContext.Current.Response.Flush();
        //HttpContext.Current.Response.Close();
    }
Beispiel #2
0
    public byte[] GetPDF(string matricula, string Mes, string Ano, string Usuario, string Senha)
    {
        matricula = Util.TratarString(matricula);
        Mes       = Util.TratarString(Mes);
        Ano       = Util.TratarString(Ano);
        Usuario   = Util.TratarString(Usuario);
        Senha     = Util.TratarString(Senha);


        if (Usuario == "IntegradorWS" && Senha == "Pontoweb2Integrador")
        {
            if (Ano == "2019")
            {
                Ano = "0";
            }
            DataSetPontoFrequencia ds = new DataSetPontoFrequencia();
            PreencheTabela         PT = new PreencheTabela();
            PT.GetVinculoUsuario(ds, matricula);
            byte[] retorno;

            string Url = "http://pontoweb.cuiaba.mt.gov.br/Relatorio/WS/frmVizualizaRelatorioWS.aspx?Mes=" + Mes + "&Setor=" + ds.TBVinculoUsuario[0].IDSetor + "&User="******"&Ano=" + Ano + "&Rel=frmZuxa&Emp=" + ds.TBVinculoUsuario[0].IDEmpresa;
            using (WebClient client = new WebClient())
            {
                retorno = client.DownloadData(Url);
                client.Dispose();
            }
            return(retorno);
        }
        else
        {
            return(null);
        }
    }
    public void MontaTexto(int IDSetor, DateTime dtfrequencia, int SituacaoN, DataSetPontoFrequencia ds)
    {
        texto = string.Empty;
        ds.EnforceConstraints = false;
        adpHoras.FillSituacaoDia(ds.vWHorasDia, IDSetor, dtfrequencia);
        texto = string.Empty;

        if (ds.vWHorasDia.Rows.Count > 0)
        {
            textoJustificado = "JUSTIFICADO(S):<br>";
            texto            = "REGISTRADO(S):<br>";
            textoAusencia    = "AUSÊNCIA(S):<br>";

            for (int i = 0; i <= (ds.vWHorasDia.Rows.Count - 1); i++)
            {
                switch (ds.vWHorasDia[i].SituacaoN)
                {
                case 1:
                    textoJustificado += string.Format("Nome: {0}<br>", ds.vWHorasDia[i].DSUsuario);
                    break;

                case 2:
                    texto += string.Format("Nome: {0}<br>", ds.vWHorasDia[i].DSUsuario);
                    break;

                case 3:
                    textoAusencia += string.Format("Nome: {0}<br>", ds.vWHorasDia[i].DSUsuario);
                    break;
                }
            }
        }

        ds = null;
    }
Beispiel #4
0
    public DataSetPontoFrequencia SetorEmpresa(int IDEmpresa)
    {
        DataSetPontoFrequencia dsP = new DataSetPontoFrequencia();
        PreencheTabela         PT  = new PreencheTabela();

        PT.PreencheTBSetorIDEmpresa(dsP, IDEmpresa);
        return(dsP);
    }
Beispiel #5
0
    public string BaterPontoHash(int IDEmpresa, int idsetorbatida, int IDUsuario, DateTime HoraBatida, string TokenAcesso,
                                 string HoraEntradaManha, string HoraSaidaManha, string horaEntradaTarde, string HoraSaidaTarde,
                                 int TotalHoraDia, string Nome, string PrimeiroNome, bool RegimePlantonista, long IDVinculoUsuario, string HashMaquina, string TempoLeitura)
    {
        string                 msg  = "";
        Frequencia             Freq = new Frequencia();
        PreencheTabela         PT   = new PreencheTabela();
        DataSetPontoFrequencia dsP  = new DataSetPontoFrequencia();

        MetodosPontoFrequencia.RegistroPonto.LogRegistro log = new MetodosPontoFrequencia.RegistroPonto.LogRegistro();
        if (TokenAcesso == "TentoWebServiceNovamente7x24dm12")
        {
            //msg = Freq.BaterPonto2(IDUsuario, IDEmpresa, HoraBatida,idsetorbatida,Convert.ToInt32(IDVinculoUsuario));
            if (IDEmpresa != 41)
            {
                msg = Freq.BaterPonto3(IDEmpresa, idsetorbatida, IDUsuario, HoraBatida,
                                       HoraEntradaManha, HoraSaidaManha, horaEntradaTarde, HoraSaidaTarde,
                                       TotalHoraDia, Nome, PrimeiroNome, RegimePlantonista, IDVinculoUsuario);
                if (idsetorbatida != 0)
                {
                    LocalRegistroFrequencia(IDEmpresa, msg, IDUsuario, idsetorbatida, HoraBatida);
                    log.LogBatida(IDEmpresa, IDUsuario, idsetorbatida, HoraBatida, HashMaquina, TempoLeitura);
                }
            }
            else
            {
                try
                {
                    //TRATATIVA DIFERENCIADA PARA ASSIST. SOCIAL/PMC //29/09/2018
                    if (IDEmpresa == 41)
                    {
                        msg = Freq.BaterPontoAssistSocial(IDEmpresa, idsetorbatida, IDUsuario,
                                                          HoraBatida, HoraEntradaManha, HoraSaidaManha,
                                                          horaEntradaTarde, HoraSaidaTarde, TotalHoraDia, Nome, PrimeiroNome,
                                                          RegimePlantonista, IDVinculoUsuario);
                        if (idsetorbatida != 0)
                        {
                            log.LogBatida(IDEmpresa, IDUsuario, idsetorbatida, HoraBatida, HashMaquina, TempoLeitura);
                            LocalRegistroFrequencia(IDEmpresa, msg + " assist.", IDUsuario, idsetorbatida, HoraBatida);
                        }
                    }
                }
                catch (Exception EX)
                {
                    EX.ToString();
                }
            }
        }
        else
        {
            msg = string.Format("Acesso a rotina não é válido.");
        }

        bateu = Freq.BATEU;

        return(msg);
    }
Beispiel #6
0
        public string VerificaAcesso2(string login, String Senha, DataSetPontoFrequencia ds)
        {
            try
            {
                ds.EnforceConstraints = false;
                adpUsuario.FillLogarUsuario2(ds.TBUsuario, login, Senha);

                if (ds.TBUsuario.Rows.Count > 0)
                {
                    autorizado      = true;
                    IDSetor         = ds.TBUsuario[0].IDSetor.ToString();
                    IDUser          = ds.TBUsuario[0].Login.ToString();
                    dssetor         = ds.TBUsuario[0].DSSetor.ToString();
                    UserLogado      = ds.TBUsuario[0].DSUsuario.ToString();
                    tpusuario       = ds.TBUsuario[0].IDTPUsuario.ToString();
                    idusuario       = ds.TBUsuario[0].IDUsuario;
                    senha           = ds.TBUsuario[0].SenhaAdmin;
                    PrimeiroNome    = ds.TBUsuario[0].PrimeiroNome.ToString();
                    PrimeiroAcesso  = ds.TBUsuario[0].PrimeiroAcesso;
                    TotHorasDiarias = ds.TBUsuario[0].TotHorasDiarias;
                    IDEmpresa       = ds.TBUsuario[0].IDEmpresa;

                    if (!ds.TBUsuario[0].IsDashboardCorporativoNull())
                    {
                        DashboardPainel = ds.TBUsuario[0].DashboardCorporativo;
                    }
                    else
                    {
                        DashboardPainel = false;
                    }

                    if (!ds.TBUsuario[0].IsSenhaDigitalNull())
                    {
                        senhaDigital = ds.TBUsuario[0].SenhaDigital;
                    }

                    //Adiconado 15/12/2015 - para atender a demanda por vinculos - qtd de vinculos
                    qtdvinculo = QTDVinculo(ds.TBUsuario[0].IDUsuario);


                    //msg = "Usuario Autorizado.";
                    log.RegistraLog(idusuario, System.DateTime.Now, "adpUsuario.LogarUsuario(ds.TBUsuario, login, Senha).ToString()", "Acesso ao Sistema", "", "", IDEmpresa);
                }
                else
                {
                    msg = "Usuario ou Senha não confere.";
                }
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                msg = "Falha ao Tentar logar. Contate o Administrador.";
            }

            return(msg);
        }
Beispiel #7
0
    protected void NomeEmpresa(int IDEmpresa)
    {
        DataSetPontoFrequencia ds = new DataSetPontoFrequencia();
        PreencheTabela         PT = new PreencheTabela();

        PT.PreencheTBEmpresaID(ds, IDEmpresa);

        lbEmpresa.Text       = PT.NomeEmpresa;
        Session["DSEMPRESA"] = PT.NomeEmpresa;
        lbEmpresa.DataBind();
    }
Beispiel #8
0
    protected void PreencheddlUsuario(string IDSetor)
    {
        MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwUsuariogridTableAdapter adpvwUsuariogrid =
            new MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwUsuariogridTableAdapter();
        MetodosPontoFrequencia.DataSetPontoFrequencia ds = new DataSetPontoFrequencia();

        ds.EnforceConstraints = false;

        adpvwUsuariogrid.FillIDEmpresaSetor(ds.vwUsuariogrid, Convert.ToInt32(Session["IDEmpresa"]), Convert.ToInt32(IDSetor));
        cbUsuario.DataSource = ds.vwUsuariogrid;
        cbUsuario.DataBind();
    }
Beispiel #9
0
    public DataSetPontoFrequencia RetornaEmpresas()
    {
        PreencheTabela         PT = new PreencheTabela();
        DataSetPontoFrequencia ds = new DataSetPontoFrequencia();

        try
        {
            PT.PreencheTBEmpresa(ds);
        }
        catch (Exception ex)
        {
            ex.ToString();
        }

        return(ds);
    }
Beispiel #10
0
    public string PontoEspecial(string login, string senha, int IDEmpresa, DateTime Data, string TokenAcesso)
    {
        string msg = "";
        DataSetPontoFrequencia ds   = new DataSetPontoFrequencia();
        Frequencia             Freq = new Frequencia();

        if (TokenAcesso == "TentoWebServiceNovamente7x24dm12")
        {
            msg = Freq.PontoEspecial(login, senha, IDEmpresa, Data, ds);
        }
        else
        {
            msg = string.Format("Acesso a rotina não é válido.");
        }

        return(msg);
    }
Beispiel #11
0
        public void PreencheIndiceClienteSIG(DataSetPontoFrequencia dsP, string DTFrequencia, int IDClienteSIG)
        {
            DataSetPontoFrequenciaTableAdapters.vwIndicePresencaTableAdapter adpIndicePresenca = new DataSetPontoFrequenciaTableAdapters.vwIndicePresencaTableAdapter();

            try
            {
                adpIndicePresenca.FillEmpresaClienteDT(dsP.vwIndicePresenca, IDClienteSIG, DTFrequencia);
            }
            catch (System.Data.OleDb.OleDbException ex)
            {
                ex.ToString();
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Beispiel #12
0
    public string PontoEspecial2(string login, string senha, int IDEmpresa, DateTime Data, string Matricula, string TokenAcesso)
    {
        //25/07/2018
        //Acrescentado matricula para a PMC.
        string msg = "";
        DataSetPontoFrequencia ds   = new DataSetPontoFrequencia();
        Frequencia             Freq = new Frequencia();

        if (TokenAcesso == "TentoWebServiceNovamente7x24dm12")
        {
            msg = Freq.PontoEspecial2(login, senha, IDEmpresa, Data, ds, Matricula);
        }
        else
        {
            msg = string.Format("Acesso a rotina não é válido.");
        }

        return(msg);
    }
Beispiel #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MetodosPontoFrequencia.Frequencia Freq = new MetodosPontoFrequencia.Frequencia();

        DataSetPontoFrequencia ds = new DataSetPontoFrequencia();

        MetodosPontoFrequencia.PreencheTabela pt = new MetodosPontoFrequencia.PreencheTabela();

        Freq.HorasDias(7, 688, 2014, ds, 4, 7);

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        Report.Load(Server.MapPath(@"~/Relatorio/RPT/rptFolhaFrequencia.mrt"));

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";

        HttpContext.Current.Response.AddHeader("Teste.pdf", "");

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true, "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit40, false);

        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "inline; filename=Teste.pdf");


        Response.BinaryWrite(memStream.ToArray());

        //Stimulsoft.Report.Web.StiReportResponse.ResponseAs(this,

        //st1.Design(Report);
    }
Beispiel #14
0
    protected string PreencheGrafico(DataSetPontoFrequencia ds, string visao, string periodo, string IDTPUsuario, string TPGrafico)
    {
        string texto     = string.Empty;
        string empresa   = string.Empty;
        string diaMesAno = string.Empty;
        string idempresa = string.Empty;
        string setor     = string.Empty;

        if (cbSetorPainel.Text != "")
        {
            setor = cbSetorPainel.Text.Trim();
        }

        if (IDTPUsuario == "7" || IDTPUsuario == "3" || IDTPUsuario == "9" || IDTPUsuario == "8")
        {
            idempresa = Session["IDEmpresa"].ToString();
            empresa   = Session["DSEmpresa"].ToString();
        }
        else if (!cbGrupoGeral.Checked && IDTPUsuario == "1") //Se não estiver marcado e usuário for admin
        {
            idempresa = cbEmpresaPainel.Value.ToString();
            empresa   = cbEmpresaPainel.Text.Trim();
        }
        else if (cbGrupoGeral.Checked)
        {
            empresa = "PREFEITURA MUNICIPAL DE CUIABÁ";
        }
        /// 11/06/2015 Definir a visão pelo tipo de usuário---
        /// O administrador possui o maior número de visão
        /// Se visao = 0 - Fazer gráfico geral - Todos os órgãos juntos
        /// Se visao = 1 - Filtrar por órgão
        /// Se visao = 2 - Filtrar por setor.
        /// 11/06/2015
        ///

        ///11/06/2015 Período
        ///Caso período = 0 - Filtrar por dia
        ///Período = 1 - Filtrar por Mês/Ano
        ///Período = 2 - Filtrar por Ano.

        if (visao == "2") //rotina permitida a todos os tipos de usuários
        {
            try
            {
                MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistroDiaEmpresaSetorUsuarioTableAdapter adpRegistroUsuario = new MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistroDiaEmpresaSetorUsuarioTableAdapter();
                dsB.EnforceConstraints = false;
                switch (periodo)
                {
                case "0":    //Dia

                    if (TPGrafico == "IndicePresenca")
                    {
                        adpRegistroSetor.FillDTDiasAno(dsP.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(cbSetorPainel.Value), Convert.ToInt32(idempresa), deDTReferencia.Date.Date);
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillDTFrequenciaIDEmpresaIDSetor(dsP.vwTotalMotivosFaltaSetor, deDTReferencia.Date.Date, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                    }

                    diaMesAno = deDTReferencia.Date.ToShortDateString();

                    dsB.EnforceConstraints = false;
                    MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vWHorasDiaTableAdapter adpHorasDia = new MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vWHorasDiaTableAdapter();
                    adpHorasDia.FillFreqDia(dsB.vWHorasDia, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value), deDTReferencia.Date.Date, deDTReferencia.Date.Date);

                    break;

                case "1":    //mês/Ano
                    if (cbMesAnoReferencia.Text != "" && cbMesAnoReferencia.Text.IndexOf('/') >= 0)
                    {
                        diaMesAno = cbMesAnoReferencia.Text.Trim();
                        string mes, ano; int pos;
                        pos = cbMesAnoReferencia.Text.IndexOf('/');
                        mes = cbMesAnoReferencia.Text.Substring(0, pos);
                        ano = cbMesAnoReferencia.Text.Substring(pos + 1, 4);

                        if (TPGrafico == "IndicePresenca")
                        {
                            adpRegistroSetor.FillMesAnoEmpresaSetor(dsP.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(ano), Convert.ToInt32(mes), Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }
                        else
                        {
                            adpMotivoFaltaSetor.FillMesAnoIDEmpresaIDSetor(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(mes), Convert.ToInt32(ano), Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }

                        adpRegistroUsuario.FillPerctMesAnoEmpresaSetor(dsB.vwRegistroDiaEmpresaSetorUsuario, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value), Convert.ToInt32(mes), Convert.ToInt32(ano));
                    }
                    else
                    {
                        diaMesAno = string.Format("{0}/{1}", System.DateTime.Now.Month, System.DateTime.Now.Year);
                        if (TPGrafico == "IndicePresenca")
                        {
                            adpRegistroSetor.FillMesAnoEmpresaSetor(dsP.vwRegistrosDiaEmpresaSetor, System.DateTime.Now.Year, System.DateTime.Now.Month, Convert.ToInt32(idempresa), Convert.ToInt32(Session["IDSETOR"]));
                        }
                        else
                        {
                            adpMotivoFaltaSetor.FillMesAnoIDEmpresaIDSetor(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Month, System.DateTime.Now.Year, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }

                        adpRegistroUsuario.FillPerctMesAnoEmpresaSetor(dsB.vwRegistroDiaEmpresaSetorUsuario, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value), System.DateTime.Now.Month, System.DateTime.Now.Year);
                    }

                    break;

                case "2":
                    if (cbMesAnoReferencia.Text.IndexOf('/') >= 0)
                    {
                        string ano1; int pos1;
                        pos1      = cbMesAnoReferencia.Text.IndexOf('/');
                        ano1      = cbMesAnoReferencia.Text.Substring(pos1 + 1, 4);
                        diaMesAno = ano1;
                        if (TPGrafico == "IndicePresenca")
                        {
                            adpRegistroSetor.FillAnoEmpresaSetor(dsP.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(ano1), Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }
                        else
                        {
                            adpMotivoFaltaSetor.FillAnoEmpresaSetor(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(ano1), Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }


                        adpRegistroUsuario.FillPercTAnoEmpresaSetor(dsB.vwRegistroDiaEmpresaSetorUsuario, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value), Convert.ToInt32(ano1));
                    }
                    else
                    {
                        diaMesAno = System.DateTime.Now.Year.ToString();
                        if (TPGrafico == "IndicePresenca")
                        {
                            adpRegistroSetor.FillAnoEmpresaSetor(dsP.vwRegistrosDiaEmpresaSetor, System.DateTime.Now.Year, Convert.ToInt32(idempresa), Convert.ToInt32(Session["IDSETOR"]));
                        }
                        else
                        {
                            adpMotivoFaltaSetor.FillAnoEmpresaSetor(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Year, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value));
                        }


                        adpRegistroUsuario.FillPercTAnoEmpresaSetor(dsB.vwRegistroDiaEmpresaSetorUsuario, Convert.ToInt32(idempresa), Convert.ToInt32(cbSetorPainel.Value), System.DateTime.Now.Year);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
            texto = string.Format("{0} / {1} - Referência: {2}", empresa, setor, diaMesAno);
            return(texto);
        }

        if ((IDTPUsuario == "1" || IDTPUsuario == "7" || IDTPUsuario == "8") && visao == "1")
        {
            //Aqui realizar o preenchimento para admin e admin de orgao

            MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistrosDiaEmpresaSetorTableAdapter adpregistroDiaEmpresaSetor = new MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistrosDiaEmpresaSetorTableAdapter();
            dsB.EnforceConstraints = false;

            switch (periodo)
            {
            case "0":        //Dia
                if (TPGrafico == "IndicePresenca")
                {
                    adpEmpresaGeral.FillIDEmpresaDTDia(dsP.vwRegistrosDiaEmpresa, Convert.ToInt32(idempresa), deDTReferencia.Date.Date);
                }
                else
                {
                    adpMotivoFaltaSetor.FillDTFrequenciaEmpresa(dsP.vwTotalMotivosFaltaSetor, deDTReferencia.Date.Date, Convert.ToInt32(idempresa));
                }
                //Data do texto
                diaMesAno = deDTReferencia.Date.ToShortDateString();

                adpregistroDiaEmpresaSetor.FillPerctDia(dsB.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(idempresa), deDTReferencia.Date.Date);
                break;

            case "1":        //Mes/Ano
                if (cbMesAnoReferencia.Text != "" && cbMesAnoReferencia.Text.IndexOf('/') >= 0)
                {
                    diaMesAno = cbMesAnoReferencia.Text.Trim();
                    string mes, ano; int pos;
                    pos = cbMesAnoReferencia.Text.IndexOf('/');
                    mes = cbMesAnoReferencia.Text.Substring(0, pos);
                    ano = cbMesAnoReferencia.Text.Substring(pos + 1, 4);

                    if (TPGrafico == "IndicePresenca")
                    {
                        adpEmpresaGeral.FilllIDEmpresaMesAno(dsP.vwRegistrosDiaEmpresa, Convert.ToInt32(mes), Convert.ToInt32(ano), Convert.ToInt32(idempresa));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillMesAnoEmpresa(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(mes), Convert.ToInt32(ano), Convert.ToInt32(idempresa));
                    }

                    adpregistroDiaEmpresaSetor.FillPerctMesAno(dsB.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(ano), Convert.ToInt32(mes), Convert.ToInt32(idempresa));
                }
                else
                {
                    diaMesAno = string.Format("{0}/{1}", System.DateTime.Now.Month, System.DateTime.Now.Year);

                    if (TPGrafico == "IndicePresenca")
                    {
                        adpEmpresaGeral.FilllIDEmpresaMesAno(dsP.vwRegistrosDiaEmpresa, System.DateTime.Now.Month, System.DateTime.Now.Year, Convert.ToInt32(idempresa));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillMesAnoEmpresa(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Month, System.DateTime.Now.Year, Convert.ToInt32(idempresa));
                    }

                    adpregistroDiaEmpresaSetor.FillPerctMesAno(dsB.vwRegistrosDiaEmpresaSetor, System.DateTime.Now.Year, System.DateTime.Now.Month, Convert.ToInt32(idempresa));
                }
                break;

            case "2":        //Ano
                if (cbMesAnoReferencia.Text.IndexOf('/') >= 0)
                {
                    diaMesAno = cbMesAnoReferencia.Text.Trim();
                    string ano; int pos;
                    pos = cbMesAnoReferencia.Text.IndexOf('/');
                    ano = cbMesAnoReferencia.Text.Substring(pos + 1, 4);

                    if (IDTPUsuario == "IndicePresenca")
                    {
                        adpEmpresaGeral.FillIDEmpresaAno(dsP.vwRegistrosDiaEmpresa, Convert.ToInt32(ano), Convert.ToInt32(idempresa));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillAnoEmpresa(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(ano), Convert.ToInt32(idempresa));
                    }

                    adpregistroDiaEmpresaSetor.FillPerctAno(dsB.vwRegistrosDiaEmpresaSetor, Convert.ToInt32(ano), Convert.ToInt32(idempresa));
                }
                else
                {
                    diaMesAno = System.DateTime.Now.Year.ToString();

                    if (IDTPUsuario == "IndicePresenca")
                    {
                        adpEmpresaGeral.FillIDEmpresaAno(dsP.vwRegistrosDiaEmpresa, System.DateTime.Now.Year, Convert.ToInt32(idempresa));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillAnoEmpresa(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Year, Convert.ToInt32(idempresa));
                    }

                    adpregistroDiaEmpresaSetor.FillPerctAno(dsB.vwRegistrosDiaEmpresaSetor, System.DateTime.Now.Year, Convert.ToInt32(idempresa));
                }
                break;
            }
            texto = string.Format("{0} - Referência: {1}", empresa, diaMesAno);
            return(texto);
        }
        if (IDTPUsuario == "1" && visao == "0")
        {
            MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistrosDiaEmpresaTableAdapter adpRegistroDiaEmpresa = new MetodosPontoFrequencia.DataSetPontoFrequenciaTableAdapters.vwRegistrosDiaEmpresaTableAdapter();
            dsB.EnforceConstraints = false;
            switch (periodo)
            {
            case "0":     //Dia
                if (TPGrafico == "IndicePresenca")
                {
                    adpEmpresaGeral.FillDTDiasAno(dsP.vwRegistrosDiaEmpresa, deDTReferencia.Date.Date);
                }
                else
                {
                    adpMotivoFaltaSetor.FillDTFrequencia(dsP.vwTotalMotivosFaltaSetor, deDTReferencia.Date.Date);
                }

                diaMesAno = deDTReferencia.Date.ToShortDateString();

                //Para usar nos gráficos de baixo - Índice de Registros, Justificativas e faltas !
                adpRegistroDiaEmpresa.FillPerctDia(dsB.vwRegistrosDiaEmpresa, deDTReferencia.Date.Date);
                break;

            case "1":     //Mes/Ano
                if (cbMesAnoReferencia.Text != "" && cbMesAnoReferencia.Text.IndexOf('/') >= 0)
                {
                    diaMesAno = cbMesAnoReferencia.Text.Trim();
                    string mes, ano; int pos;
                    pos = cbMesAnoReferencia.Text.IndexOf('/');
                    mes = cbMesAnoReferencia.Text.Substring(0, pos);
                    ano = cbMesAnoReferencia.Text.Substring(pos + 1, 4);
                    if (TPGrafico == "IndicePresenca")
                    {
                        adpEmpresaGeral.FillMesAno(dsP.vwRegistrosDiaEmpresa, Convert.ToInt32(mes), Convert.ToInt32(ano));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillMesAno(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(mes), Convert.ToInt32(ano));
                    }

                    //Gráficos de baixo
                    adpRegistroDiaEmpresa.FillPerctMesAno(dsB.vwRegistrosDiaEmpresa, Convert.ToInt32(mes), Convert.ToInt32(ano));
                }
                else
                {
                    diaMesAno = string.Format("{0}/{1}", System.DateTime.Now.Month, System.DateTime.Now.Year);

                    if (TPGrafico == "IndicePresenca")
                    {
                        adpEmpresaGeral.FillMesAno(dsP.vwRegistrosDiaEmpresa, System.DateTime.Now.Month, System.DateTime.Now.Year);
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillMesAno(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Month, System.DateTime.Now.Year);
                    }

                    //Para usar nos gráficos de baixo - Índice de Registros, Justificativas e faltas !
                    adpRegistroDiaEmpresa.FillPerctMesAno(dsB.vwRegistrosDiaEmpresa, System.DateTime.Now.Month, System.DateTime.Now.Year);
                }
                break;

            case "2":     //Ano
                if (cbMesAnoReferencia.Text != "" && cbMesAnoReferencia.Text.IndexOf('/') < 0)
                {
                    diaMesAno = cbMesAnoReferencia.Text.Trim();
                    string ano; int pos;
                    pos = cbMesAnoReferencia.Text.IndexOf('/');
                    ano = cbMesAnoReferencia.Text.Substring(pos + 1, 4);
                    if (TPGrafico == "IndicePresenca")
                    {
                        adpEmpresaGeral.FillAno(dsP.vwRegistrosDiaEmpresa, Convert.ToInt32(ano));
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillAno(dsP.vwTotalMotivosFaltaSetor, Convert.ToInt32(ano));
                    }

                    //Gráficos de baixo
                    adpRegistroDiaEmpresa.FillPerctAno(dsB.vwRegistrosDiaEmpresa, Convert.ToInt32(ano));
                }
                else
                {
                    diaMesAno = System.DateTime.Now.Year.ToString();
                    if (TPGrafico == "IndicePresencao")
                    {
                        adpEmpresaGeral.FillAno(dsP.vwRegistrosDiaEmpresa, System.DateTime.Now.Year);
                    }
                    else
                    {
                        adpMotivoFaltaSetor.FillAno(dsP.vwTotalMotivosFaltaSetor, System.DateTime.Now.Year);
                    }

                    //Gráficos de baixo
                    adpRegistroDiaEmpresa.FillPerctAno(dsB.vwRegistrosDiaEmpresa, System.DateTime.Now.Year);
                }
                break;
            }
            texto = string.Format("{0} - Referência: {1}", empresa, diaMesAno);
            return(texto);
        }

        return(texto);
    }
 public void SelecionaGrafico(DataSetPontoFrequencia ds)
 {
     DataSetPontoFrequenciaTableAdapters.viewDadoTableAdapter adpViwDado = new DataSetPontoFrequenciaTableAdapters.viewDadoTableAdapter();
     adpViwDado.Fill(ds.viewDado);
 }
 public void Seleciona(DataSetPontoFrequencia ds)
 {
     DataSetPontoFrequenciaTableAdapters.TBTesteAutomaticoTableAdapter adpTeste = new DataSetPontoFrequenciaTableAdapters.TBTesteAutomaticoTableAdapter();
     adpTeste.Fill(ds.TBTesteAutomatico);
 }
Beispiel #17
0
    public void MontaTextoUsuarioComum(int IDUsuario, int IDVinculoUsuario, int MesReferencia, int AnoReferencia, string Situacao, DataSetPontoFrequencia ds, int IDEmpresa)
    {
        texto = string.Empty;
        ds.EnforceConstraints = false;
        adpHoras.Connection.Open();
        adpHoras.FillSituacaoDiaUsuario(ds.vWHorasDia, IDUsuario, IDVinculoUsuario, AnoReferencia, MesReferencia, IDEmpresa);
        adpHoras.Connection.Close();

        if (ds.vWHorasDia.Rows.Count > 0)
        {
            textoJustificado = "JUSTIFICADO(S):<br>";
            texto            = "EFETUOU REGISTRO:<br>";
            textoAusencia    = "NÃO EFETUOU REGISTRO:<br>";

            for (int i = 0; i <= (ds.vWHorasDia.Rows.Count - 1); i++)
            {
                switch (ds.vWHorasDia[i].SituacaoN)
                {
                case 1:
                    textoJustificado += string.Format("{0}<br>", ds.vWHorasDia[i].DataFrequencia);
                    break;

                case 2:
                    texto += string.Format("{0}<br>", ds.vWHorasDia[i].DataFrequencia);
                    break;

                case 3:
                    textoAusencia += string.Format("{0}<br>", ds.vWHorasDia[i].DataFrequencia);
                    break;
                }
            }
        }
    }