Exemple #1
0
        public TBFechamentoFolha GetEmpresaProcessada(string mes, string empresa)
        {
            TBFechamentoFolha dado  = new TBFechamentoFolha();
            string            query = string.Format("select IDFechamento, Mes, Ano, DataProcessamento, IDEmpresa from TBFechamentoFolha where IDEmpresa = {0} and Mes = {1} and Ano = {2}", empresa, mes, DateTime.Now.Year);

            return(ReturnEmpresaProcessada(query));
        }
Exemple #2
0
        public TBFechamentoFolha ReturnEmpresaProcessada(string query)
        {
            TBFechamentoFolha dado   = new TBFechamentoFolha();
            IDataReader       reader = Util.getDataReader(query);

            using (reader)
            {
                while (reader.Read())
                {
                    dado.IDFechamento      = int.Parse(reader["IDFechamento"].ToString());
                    dado.IDEmpresa         = int.Parse(reader["IDEmpresa"].ToString());
                    dado.Ano               = int.Parse(reader["Ano"].ToString());
                    dado.Mes               = int.Parse(reader["Mes"].ToString());
                    dado.DataProcessamento = DateTime.Parse(reader["DataProcessamento"].ToString());
                }
            }
            return(dado);
        }
Exemple #3
0
    protected void btnReprocessar_Click(object sender, ImageClickEventArgs e)
    {
        int id = Convert.ToInt32(((sender as ImageButton).Parent as GridViewDataItemTemplateContainer).KeyValue);
        TBFechamentoFolha folha   = fechamentoFolhaSrv.GetEmpresaProcessada(id);
        List <int>        setores = fechamentoFolhaSrv.GetSetoresBYEmpresaProcessados(id);
        List <int>        cargos  = fechamentoFolhaSrv.GetCargosBYEmpresaProcessados(id);
        string            retorno = fechamentoFolhaSrv.Processar(folha.Mes.ToString(), folha.IDEmpresa.ToString(), String.Join(", ", setores.ToArray()), String.Join(", ", cargos.ToArray()), id);

        if (string.IsNullOrEmpty(retorno))
        {
            cbSecretaria_TextChanged(null, null);
            PopulaGridProcessados();
            Msg("Secretaria Reprocessada com Sucesso!", true);
        }
        else
        {
            Msg(retorno, true);
        }
    }