Exemplo n.º 1
0
    public static NameValueCollection CalculateIncome(int _age)
    {
        NameValueCollection option_incomes = new NameValueCollection();
        decimal             _redFactor, _rateFactor, option_300, option_400, option_500, option_800;

        _redFactor  = Imputed_DAL.GetFactor(_age, "RedFactor");
        _rateFactor = Imputed_DAL.GetFactor(_age, "RateFactor");

        option_300 = ((300 * _redFactor) - 50) * _rateFactor; option_incomes.Add("option_300", option_300.ToString("C"));
        option_400 = ((400 * _redFactor) - 50) * _rateFactor; option_incomes.Add("option_400", option_400.ToString("C"));
        option_500 = ((500 * _redFactor) - 50) * _rateFactor; option_incomes.Add("option_500", option_500.ToString("C"));
        option_800 = ((800 * _redFactor) - 50) * _rateFactor; option_incomes.Add("option_800", option_800.ToString("C"));

        return(option_incomes);
    }
Exemplo n.º 2
0
    protected void lnk_Submit_OnClick(object sender, EventArgs e)
    {
        int                 _empno, _age;
        DateTime            _dob;
        NameValueCollection option_incomes;

        lbl_err.Text = "";

        try
        {
            _empno = Convert.ToInt32(tbx_empno.Text);

            Imputed_DAL.CheckActivePilot(_empno);

            if ((tbx_dob.Text != null) && (tbx_dob.Text.Trim() != String.Empty))
            {
                _dob = Convert.ToDateTime(tbx_dob.Text);
            }
            else
            {
                _dob         = Imputed_DAL.GetDob(_empno);
                tbx_dob.Text = _dob.ToString("MM/dd/yyyy");
            }

            _age = Imputed_BAL.GetImputedAge(_dob);

            tbx_age.Text = _age.ToString();

            option_incomes = Imputed_BAL.CalculateIncome(_age);

            tbx_300.Text = option_incomes.Get("option_300");
            tbx_400.Text = option_incomes.Get("option_400");
            tbx_500.Text = option_incomes.Get("option_500");
            tbx_800.Text = option_incomes.Get("option_800");
        }
        catch (Exception ex)
        {
            ClearControlsValue();
            lbl_err.Text = "Error: " + ex.Message;
        }
    }