public void CarregarCampos(string id) { lblCod.Text = id; FolhaPgmtBusiness business = new FolhaPgmtBusiness(); view_func_folha folha = business.ConsultarPorId(id); lblNome.Text = folha.nm_NomeFunc; lblFuncao.Text = folha.ds_Cargo; lblDiasTrabalhados.Text = folha.ds_DiasTrabalhados.ToString(); lblSalario.Text = Math.Round(folha.vl_SalarioBruto, 2).ToString(); lblVencimentos.Text = folha.vl_Proventos.ToString(); lblDescontos.Text = folha.vl_Descontos.ToString(); lblReceber.Text = folha.vl_Liquido.ToString(); lblValeTransporte.Text = folha.vl_VT.ToString(); lblValeRefeicao.Text = folha.vl_VR.ToString(); lblINSS.Text = folha.vl_INSS.ToString(); lblHoraE50.Text = folha.vl_HoraE50.ToString(); lblHoraE100.Text = folha.vl_HoraE100.ToString(); lblMensagem.Text = folha.ds_Mensagem; lblSalarioBase.Text = folha.vl_SalarioBruto.ToString(); lblINSSBase.Text = folha.vl_BaseINSS.ToString(); lblFGTSBase.Text = folha.vl_BaseFGTS.ToString(); lblFGTSMes.Text = folha.vl_FGTSmes.ToString(); lblBaseIRRF.Text = folha.vl_BaseIRRF.ToString(); lblFaixaIRRF.Text = folha.vl_FaixaIRRF.ToString(); }
private void btnVisualizar_Click(object sender, EventArgs e) { view_func_folha data = dgvFolha.CurrentRow.DataBoundItem as view_func_folha; frmVisualizar frm = new frmVisualizar(); frm.CarregarCampos(data.id_Folha_Pgmt.ToString()); frm.Show(); }
public FolhaPgmtDTO Folha(string id, FolhaPgmtDTO dto) { FolhaPgmtDatabase business = new FolhaPgmtDatabase(); view_func_folha folha = business.ConsultarPorIdCalc(id); int dM = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); decimal mes_valor = Mes_Valor(folha.vl_SalarioBruto, dM, folha.ds_DiasTrabalhados); decimal valor_trab_50 = Valor_Trab_50(folha.ds_HoraE50, Valor_Hora_50(Convert.ToDouble(Valor_Hora(folha.vl_SalarioBruto)))); decimal valor_trab_100 = Valor_Trab_100(folha.ds_HoraE100, Valor_Hora_100(Convert.ToDouble(Valor_Hora(folha.vl_SalarioBruto)))); decimal deducao_ir = Deducao_IR(folha.vl_SalarioBruto); decimal totalDeProventos = Math.Round(mes_valor + valor_trab_50 + valor_trab_100 + deducao_ir, 2); decimal totalDeDescontos = Math.Round(ValorINSS(folha.vl_SalarioBruto) + ValorFGTS(folha.vl_SalarioBruto) + ValorFinar_IR(ValorIR(folha.vl_SalarioBruto), Deducao_IR(folha.vl_SalarioBruto)) + ValorIR(folha.vl_SalarioBruto) + ValorVR(folha.vl_SalarioBruto) + ValorVT(folha.vl_SalarioBruto), 2); decimal totalLiquido = Math.Round(totalDeProventos - totalDeDescontos, 2); decimal vlValeTransporte = Math.Round(ValorVT(folha.vl_SalarioBruto), 2); decimal vlValeRefeicao = Math.Round(ValorVR(folha.vl_SalarioBruto), 2); decimal vlINSS = Math.Round(ValorINSS(folha.vl_SalarioBruto), 2); decimal vlHoraE50 = Math.Round(Valor_Hora_50(Convert.ToDouble(Valor_Hora(folha.vl_SalarioBruto))), 2); decimal vlHoraE100 = Math.Round(Valor_Hora_100(Convert.ToDouble(Valor_Hora(folha.vl_SalarioBruto))), 2); decimal vlBaseINSS = Math.Round(ValorINSS(folha.vl_SalarioBruto), 2); decimal vlBaseFGTS = Math.Round(ValorFGTS(folha.vl_SalarioBruto), 2); decimal vlMesFGTS = Math.Round(ValorFGTS(folha.vl_SalarioBruto), 2); decimal vlBaseIRRF = Math.Round(ValorIR(folha.vl_SalarioBruto), 2); decimal vlFaixaIRRF = Math.Round(Deducao_IR(folha.vl_SalarioBruto), 2); dto.vl_BaseFGTS = vlBaseFGTS; dto.vl_BaseINSS = vlBaseINSS; dto.vl_BaseIRRF = vlBaseIRRF; dto.vl_Descontos = totalDeDescontos; dto.vl_FaixaIRRF = vlFaixaIRRF; dto.vl_FGTSmes = vlMesFGTS; dto.vl_HoraE100 = vlHoraE100; dto.vl_HoraE50 = vlHoraE50; dto.vl_INSS = vlINSS; dto.vl_Liquido = totalLiquido; dto.vl_Proventos = totalDeProventos; dto.vl_VR = ValorVR(folha.vl_SalarioBruto); dto.vl_VT = ValorVT(folha.vl_SalarioBruto); dto.vl_mesSalario = mes_valor; dto.vl_DedIR = deducao_ir; dto.vl_IR = ValorIR(folha.vl_SalarioBruto); dto.vl_ValorIR = ValorFinar_IR(ValorIR(folha.vl_SalarioBruto), Deducao_IR(folha.vl_SalarioBruto)); dto.vl_ValorFGTS = ValorFGTS(folha.vl_SalarioBruto); return(dto); }
public void CarregarCampos(string id) { lblId.Text = id; FolhaPgmtBusiness business = new FolhaPgmtBusiness(); view_func_folha folha = business.ConsultarPorId(id); txtCPF.Text = folha.ds_CPF; txtCargo.Text = folha.ds_Cargo; txtDias.Text = folha.ds_DiasTrabalhados.ToString(); txtHorasE100.Text = folha.ds_HoraE100.ToString(); txtHorasE50.Text = folha.ds_HoraE50.ToString(); txtMensagem.Text = folha.ds_Mensagem; txtNome.Text = folha.nm_NomeFunc; txtSalarioBruto.Text = folha.vl_SalarioBruto.ToString(); }
private void btnAlterar_Click(object sender, EventArgs e) { try { view_func_folha data = dgvFolha.CurrentRow.DataBoundItem as view_func_folha; frmAlterar frm = new frmAlterar(); Hide(); frm.CarregarCampos(data.id_Folha_Pgmt.ToString()); frm.ShowDialog(); Show(); CarregarGrid(); } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception) { MessageBox.Show("Ocorreu um erro não identificado.", "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnRemover_Click(object sender, EventArgs e) { try { view_func_folha data = dgvFolha.CurrentRow.DataBoundItem as view_func_folha; FolhaPgmtBusiness business = new FolhaPgmtBusiness(); business.RemoverFolha(data.id_Folha_Pgmt); CarregarGrid(); MessageBox.Show("Folha de Pagamento Removido com Sucesso!", "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception) { MessageBox.Show("Ocorreu um erro não identificado.", "Black Fit LTDA", MessageBoxButtons.OK, MessageBoxIcon.Error); } }