Ejemplo n.º 1
0
        //load general settings
        private bool Load()
        {
            try
            {
                //Settings
                decimal.TryParse(rep.SettingLookup("MRELIEF"), out _defaultRelief_Married);
                decimal.TryParse(rep.SettingLookup("SRELIEF"), out _defaultRelief_Single);
                //Settings
                decimal.TryParse(rep.SettingLookup("PEN1E"), out _EmployeeRate);
                decimal.TryParse(rep.SettingLookup("PEN1R"), out _EmployerRate);

                pensionSchemeFlag = rep.SettingLookup("DEFCONTRSCHEME");

                //load employee info
                if (!anonymous)
                {
                    employee       = rep.GetEmployee(_EmployeeId);
                    _MaritalStatus = employee.MaritalStatus;

                    decimal _HourlyPay = rep.GetHourlyPay(_EmployeeId);
                    if (this.employee.BasicComputation.Equals("H"))
                    {
                        _Basic = _HourlyPay;
                    }
                    else if (this.employee.BasicComputation.Equals("X"))
                    {
                        _Basic += _HourlyPay;
                    }
                    else
                    {
                        _Basic = employee.BasicPay ?? 0;
                    }


                    //Employer Record
                    employer = rep.GetEmployeeEmployer(employee.EmployerId);

                    _PensionableEarnings = rep.PensionableEarnings(_EmployeeId);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log.WriteToErrorLogFile(ex);
                _erorr  = true;
                _errMsg = "Error processing Load() \n" + ex.Message;
                return(false);
            }
        }