Exemple #1
0
        private void btnDesconto_Click(object sender, EventArgs e)
        {
            if (double.TryParse(mtbSalBruto.Text, out Salb) &&
                double.TryParse(mtbNumFilho.Text, out nFilhos) &&
                (rdbHomem.Checked || rdbMulher.Checked))
            {
                if (Salb <= 800.47)
                {
                    DescINSS        = (7.65 / 100) * Salb;
                    txtAliInss.Text = "7,65%";
                }
                else if (Salb <= 1050)
                {
                    DescINSS        = (8.65 / 100) * Salb;
                    txtAliInss.Text = "8,65%";
                }
                else if (Salb <= 1400.77)
                {
                    DescINSS        = (9 / 100) * Salb;
                    txtAliInss.Text = "9,00%";
                }
                else if (Salb <= 2801.56)
                {
                    DescINSS        = (11 / 100) * Salb;
                    txtAliInss.Text = "11,00%";
                }
                else
                {
                    DescINSS        = 308.17;
                    txtAliInss.Text = "Teto";
                }

                if (Salb <= 1257.12)
                {
                    txtAliIrpf.Text      = "isento";
                    txtDescontoIrpf.Text = "0";
                }
                else if (Salb <= 2512.08)
                {
                    txtAliIrpf.Text = "15,00%";
                    DescIRPF        = (15 / 100) * Salb;
                }
                else
                {
                    txtAliIrpf.Text = "27,50%";
                    DescIRPF        = (27.5 / 100) * Salb;
                }

                if (Salb < 435.52)
                {
                    SalFam = 22.33 * nFilhos;
                }
                else if (Salb <= 654.61)
                {
                    SalFam = 15.74 * nFilhos;
                }
                else
                {
                    SalFam = 0;
                }
            }
            else
            {
                MessageBox.Show("Dados insuficientes");
            }



            SalLiq = Salb + (SalFam) - (DescIRPF + DescINSS);

            txtDescontoIrpf.Text = DescIRPF.ToString();
            txtSalFamilia.Text   = SalFam.ToString();
            txtSalLiquido.Text   = SalLiq.ToString();
            txtDescontoInss.Text = DescINSS.ToString();
        }
Exemple #2
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            if (double.TryParse(mskdtxtSalbrut.Text, out Salb) &&
                double.TryParse(mskdtxtboxFilhos.Text, out nFilhos) &&
                (rbdnF.Checked || rbdnM.Checked))
            {
                //calculo INSS
                if (Salb <= 800.47)
                {
                    DescINSS       = (7.65 / 100) * Salb;
                    txtAliqin.Text = "7,65%";
                }
                else if (Salb <= 1050)
                {
                    DescINSS       = (8.65 / 100) * Salb;
                    txtAliqin.Text = "8,65%";
                }
                else if (Salb <= 1400.77)
                {
                    DescINSS       = (9 / 100) * Salb;
                    txtAliqin.Text = "9,00%";
                }
                else if (Salb <= 2801.56)
                {
                    DescINSS       = (11 / 100) * Salb;
                    txtAliqin.Text = "11,00%";
                }
                else
                {
                    DescINSS       = 308.17;
                    txtAliqin.Text = "Teto";
                }
                //irpf
                if (Salb <= 1257.12)
                {
                    txtAliqir.Text = "isento";
                    txtDescir.Text = "0";
                }
                else if (Salb <= 2512.08)
                {
                    txtAliqir.Text = "15,00%";
                    DescIRPF       = (15 / 100) * Salb;
                }
                else
                {
                    txtAliqir.Text = "27,50%";
                    DescIRPF       = (27.5 / 100) * Salb;
                }
                //salario familia
                if (Salb < 435.52)
                {
                    SalFam = 22.33 * nFilhos;
                }
                else if (Salb <= 654.61)
                {
                    SalFam = 15.74 * nFilhos;
                }
                else
                {
                    SalFam = 0;
                }
            }
            else
            {
                MessageBox.Show("Preenche tudo ai");
            }



            SalLiq = Salb + (SalFam) - (DescIRPF + DescINSS);

            txtDescir.Text = DescIRPF.ToString();
            txtSalf.Text   = SalFam.ToString();
            txtSalliq.Text = SalLiq.ToString();
            txtDescin.Text = DescINSS.ToString();
        }