Beispiel #1
0
        private void PaperSalary()
        {
            double.TryParse(txt1PaperSalary.Text, out double salary);
            double.TryParse(mtxtMinSalary.Text, out double minSalary);
            double.TryParse(mtxtIncomeTaxInput.Text, out double incTaxInput);
            double.TryParse(mtxtNpdInput.Text, out double npdInput);
            double.TryParse(mtxtPnpdInput.Text, out double pnpdInput);
            double.TryParse(mtxtHealthInsInput.Text, out double healthInsInput);
            double.TryParse(mtxtSocInsInput.Text, out double socInsInput);
            double.TryParse(mtxtEmployerTaxInput.Text, out double employerTaxInput);
            double.TryParse(mtxtAuthRightsInput.Text, out double authRightsInput);
            int.TryParse(cbox1ChildCount.Text, out int childCount);
            double.TryParse(mtxt1AuthRightsIncome.Text, out double authRights);

            Calcs calc = new Calcs();

            calc.SetSalary(salary);
            calc.SetMinSalary(minSalary);
            calc.SetIncomeTaxInput(incTaxInput);
            calc.SetNpdInput(npdInput);
            calc.SetPnpdInput(pnpdInput);
            calc.SetHealthInsuranceInput(healthInsInput);
            calc.SetSocInsuranceInput(socInsInput);
            calc.SetEmployerTaxInput(employerTaxInput);
            calc.SetAuthRightsTaxInput(authRightsInput);
            calc.SetChild(childCount);
            calc.SetParents(rbtn1OneParent.Checked);
            calc.SetAuthRightsCheckbox(chk1AuthRightsIncome.Checked);
            calc.SetAuthRightsIncome(authRights);

            calc.CalculateSalary();

            mtxt1Npd.Text             = calc.GetNpd().ToString("N2");
            mtxt1Pnpd.Text            = calc.GetPnpd().ToString("N2");
            mtxt1IncomeTax.Text       = calc.GetIncomeTax().ToString("N2");
            mtxt1HealthInsurance.Text = calc.GetHealthInsurance().ToString("N2");
            mtxt1SocInsurance.Text    = calc.GetSocInsurance().ToString("N2");
            mtxt1EmployerTax.Text     = calc.GetEmployerTax().ToString("N2");
            mtxt1WorkCost.Text        = calc.GetWorkCost().ToString("N2");
            if (chk1AuthRightsIncome.Checked)
            {
                mtxt1AuthRightsIncomeTax.Text = calc.GetAuthRightsTax().ToString("N2");
            }
            mtxt1InHandSalary.Text = calc.GetSalary().ToString("N2");
        }