public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            ISocialProfile conceptProfile = evalProfile.Social();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TAmountDec incomeTotalsGeneral = conceptProfile.IncludeGeneralIncomes(evalPeriod,
                                                                                  conceptValues.SummarizeType, conceptValues.IncludeIncome, conceptValues.ExcludeIncome);
            TAmountDec incomeTotalsExclude = conceptProfile.ExcludeGeneralIncomes(evalPeriod,
                                                                                  conceptValues.SummarizeType, conceptValues.IncludeIncome, conceptValues.ExcludeIncome);
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddIncomeInsSocialValue(conceptValues.SummarizeType, incomeTotalsGeneral, incomeTotalsExclude);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            ITaxingProfile conceptProfile = evalProfile.Taxing();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }
            ISocialProfile socialsProfile = evalProfile.Social();

            if (socialsProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, SOCIALS_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            TAmountDec startedBasisAmount = conceptProfile.TaxableIncomesAdvanceTaxingMode(evalPeriod,
                                                                                           conceptValues.GeneralIncome, conceptValues.ExcludeIncome,
                                                                                           conceptValues.LolevelIncome, conceptValues.TaskAgrIncome, conceptValues.PartnerIncome);

            TAmountDec employerPercFactor = socialsProfile.FactorEmployer();
            TAmountDec roundedBasisAmount = conceptProfile.DecRoundUp(startedBasisAmount);
            TAmountDec cutdownBasisAmount = conceptProfile.TaxablePartialAdvanceSocial(evalPeriod, roundedBasisAmount, conceptValues.ExcludeIncome);
            TAmountDec cutdownAboveAmount = conceptProfile.CutDownPartialAdvanceSocial(evalPeriod, roundedBasisAmount, conceptValues.ExcludeIncome);
            TAmountDec finaledBasisAmount = conceptProfile.EployerPartialAdvanceSocial(evalPeriod, cutdownBasisAmount, employerPercFactor);
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddMoneyInsuranceBasisValue(startedBasisAmount, roundedBasisAmount,
                                                      cutdownBasisAmount, cutdownAboveAmount, finaledBasisAmount);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
Example #3
0
        public static IEnumerable <ResultPack> EvaluateConcept(ConfigBase evalConfig, Period evalPeriod, IPeriodProfile evalProfile,
                                                               Result <MasterItem.EvaluateSource, string> prepValues)
        {
            ISocialProfile conceptProfile = evalProfile.Social();

            if (conceptProfile == null)
            {
                return(EvaluateUtils.DecoratedError(CONCEPT_DESCRIPTION_ERROR_FORMAT, CONCEPT_PROFILE_NULL_TEXT));
            }

            MasterItem.EvaluateSource conceptValues = prepValues.Value;
            // EVALUATION
            Byte foreignerType = 0;
            // EVALUATION

            IArticleResult conceptResult = new ArticleGeneralResult(evalConfig);

            // SET RESULT VALUES
            conceptResult.AddDeclarationSocialValue(conceptValues.StatementType,
                                                    conceptValues.SummarizeType, conceptValues.TotalYearBase, foreignerType);
            // SET RESULT VALUES

            return(EvaluateUtils.Results(conceptResult));
        }
        public void Logon(string userName, string password)
        {
            HashAlgorithm md5 = MD5.Create();
            byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes(userName.Trim().ToLower()));
            string hashStr = string.Join(string.Empty, hash.Select(b => b.ToString("x2")).ToArray());

            this.LoggedOnUserName = userName;
            this.loggedOnUser = new Profile(this, hashStr);
        }