示例#1
0
        public view_func_folha ConsultarPorIdCalc(string id)
        {
            string script = $"SELECT * FROM view_func_folha WHERE id_Folha_Pgmt = '{id}'";

            List <MySqlParameter> parms = new List <MySqlParameter>();

            Database        db     = new Database();
            MySqlDataReader reader = db.ExecuteSelectScript(script, parms);

            view_func_folha folha = new view_func_folha();

            if (reader.Read())
            {
                folha.id_Folha_Pgmt      = reader.GetInt32("id_Folha_Pgmt");
                folha.dt_Registro        = reader.GetDateTime("dt_Registro");
                folha.vl_SalarioBruto    = reader.GetDecimal("vl_SalarioBruto");
                folha.ds_DiasTrabalhados = reader.GetInt32("ds_DiasTrabalhados");
                folha.ds_Cargo           = reader.GetString("ds_Cargo");
                folha.ds_HoraE50         = reader.GetInt32("ds_HoraE50");
                folha.ds_HoraE100        = reader.GetInt32("ds_HoraE100");
                folha.ds_Mensagem        = reader.GetString("ds_Mensagem");
                folha.fk_FolhaPgmt_Func  = reader.GetInt32("fk_FolhaPgmt_Func");
                folha.nm_NomeFunc        = reader.GetString("nm_NomeFunc");
                folha.ds_CPF             = reader.GetString("ds_CPF");
            }
            reader.Close();
            return(folha);
        }
示例#2
0
        public view_func_folha ConsultarPorId(string id)
        {
            string script = $"SELECT * FROM view_func_folha WHERE id_Folha_Pgmt = '{id}'";

            List <MySqlParameter> parms = new List <MySqlParameter>();

            Database        db     = new Database();
            MySqlDataReader reader = db.ExecuteSelectScript(script, parms);

            view_func_folha folha = new view_func_folha();

            if (reader.Read())
            {
                folha.id_Folha_Pgmt      = reader.GetInt32("id_Folha_Pgmt");
                folha.dt_Registro        = reader.GetDateTime("dt_Registro");
                folha.vl_SalarioBruto    = reader.GetDecimal("vl_SalarioBruto");
                folha.ds_DiasTrabalhados = reader.GetInt32("ds_DiasTrabalhados");
                folha.ds_Cargo           = reader.GetString("ds_Cargo");
                folha.ds_HoraE50         = reader.GetInt32("ds_HoraE50");
                folha.ds_HoraE100        = reader.GetInt32("ds_HoraE100");
                folha.ds_Mensagem        = reader.GetString("ds_Mensagem");
                folha.fk_FolhaPgmt_Func  = reader.GetInt32("fk_FolhaPgmt_Func");
                folha.nm_NomeFunc        = reader.GetString("nm_NomeFunc");
                folha.ds_CPF             = reader.GetString("ds_CPF");
                folha.vl_BaseFGTS        = reader.GetDecimal("vl_BaseFGTS");
                folha.vl_BaseINSS        = reader.GetDecimal("vl_BaseINSS");
                folha.vl_BaseIRRF        = reader.GetDecimal("vl_BaseIRRF");
                folha.vl_Descontos       = reader.GetDecimal("vl_Descontos");
                folha.vl_FaixaIRRF       = reader.GetDecimal("vl_FaixaIRRF");
                folha.vl_FGTSmes         = reader.GetDecimal("vl_FGTSmes");
                folha.vl_HoraE100        = reader.GetDecimal("vl_HoraE100");
                folha.vl_HoraE50         = reader.GetDecimal("vl_HoraE50");
                folha.vl_mesSalario      = reader.GetDecimal("vl_mesSalario");
                folha.vl_INSS            = reader.GetDecimal("vl_INSS");
                folha.vl_Liquido         = reader.GetDecimal("vl_Liquido");
                folha.vl_Proventos       = reader.GetDecimal("vl_Proventos");
                folha.vl_VR        = reader.GetDecimal("vl_VR");
                folha.vl_VT        = reader.GetDecimal("vl_VT");
                folha.vl_DedIR     = reader.GetDecimal("vl_DedIR");
                folha.vl_IR        = reader.GetDecimal("vl_IR");
                folha.vl_ValorIR   = reader.GetDecimal("vl_ValorIR");
                folha.vl_ValorFGTS = reader.GetDecimal("vl_ValorFGTS");
            }
            reader.Close();
            return(folha);
        }
示例#3
0
        public view_func_folha ConsultarPorId(string id)
        {
            FolhaPgmtDatabase db          = new FolhaPgmtDatabase();
            view_func_folha   funcionario = db.ConsultarPorId(id);

            if (funcionario.nm_NomeFunc != string.Empty)
            {
                DESCripto cripto = new DESCripto();

                funcionario.nm_NomeFunc = cripto.Descriptografar(Program.chave, funcionario.nm_NomeFunc);
                funcionario.ds_CPF      = cripto.Descriptografar(Program.chave, funcionario.ds_CPF);

                return(funcionario);
            }
            else
            {
                return(funcionario);
            }
        }