private void PopulateMetalTypes()
        {
            bool   bPawnValue;
            string sMetalType      = String.Empty;
            string sComponentValue = String.Empty;

            BusinessRuleVO brMETAL_TYPES = brMetalType;

            bPawnValue = brMETAL_TYPES.getComponentValue("GOLD_TYPES", ref sComponentValue);
            if (bPawnValue)
            {
                _listGoldTypes.AddRange(sComponentValue.Split('|'));

                //if (listGoldTypes.FindIndex(delegate(string s)
                //{
                //    return s == _Item.Attributes[iMetalIdx].Answer.AnswerText;
                //}) >= 0)
                //{
                //    sMetalType = "GOLD";
                //}
            }

            if (sMetalType == String.Empty)
            {
                bPawnValue = brMETAL_TYPES.getComponentValue("OTHER_TYPES", ref sComponentValue);
                if (bPawnValue)
                {
                    _listOtherTypes.AddRange(sComponentValue.Split('|'));

                    //if (listOtherTypes.FindIndex(delegate(string s)
                    //{
                    //    return s == _Item.Attributes[iMetalIdx].Answer.AnswerText;
                    //}) >= 0)
                    //{
                    //    sMetalType = "PLATINUM";
                    //}
                }
            }
        }
Ejemplo n.º 2
0
        //-------

        public static PawnLoan GetCurrentLoanFees(SiteId siteId, PawnLoan pawnLoan, out UnderwritePawnLoanVO underwritePawnLoanVO)
        {
            decimal currentValue;

            PawnLoan _PawnLoan = Utilities.CloneObject(pawnLoan);
            // call UnderWrite Pawn Loan
            var upw = new UnderwritePawnLoanUtility(GlobalDataAccessor.Instance.DesktopSession);

            upw.RunUWP(siteId);

            underwritePawnLoanVO = upw.PawnLoanVO;

            // CL_PWN_0013_MININTAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0013_MININTAMT", out currentValue);
            Fee fee = new Fee
            {
                FeeType = FeeTypes.MINIMUM_INTEREST,
                Value   = currentValue
            };

            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0018_SETUPFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0018_SETUPFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.SETUP,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0022_CITYFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0022_CITYFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.CITY,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0026_FIREARMFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0026_FIREARMFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.FIREARM,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0040_PFIMAILFEE
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0040_PFIMAILFEE", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.MAILER_CHARGE,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0101_LOANFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0101_LOANFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.LOAN,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0103_ORIGINFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0103_ORIGINFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.ORIGIN,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0104_ADMINFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0104_ADMINFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.ADMINISTRATIVE,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0105_INITCHGFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0105_INITCHGFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.INITIAL,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0106_PROCFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0106_PROCFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.PROCESS,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0115_PPCITYFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0115_PPCITYFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.PREPAID_CITY,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0030_STRGFEE
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0030_STRGFEE", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.STORAGE,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0033_MAXSTRGFEE
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0033_MAXSTRGFEE", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.STORAGE_MAXIMUM,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0037_TICKETFEE
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0037_TICKETFEE", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.TICKET,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            // CL_PWN_0102_PREPFEEAMT
            underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0102_PREPFEEAMT", out currentValue);
            fee = new Fee
            {
                FeeType = FeeTypes.PREPARATION,
                Value   = currentValue
            };
            UpdatePawnLoanFee(_PawnLoan, fee);

            BusinessRuleVO businessRule    = GlobalDataAccessor.Instance.DesktopSession.PawnBusinessRuleVO["PWN_BR-054"];
            var            sComponentValue = string.Empty;

            if (sComponentValue.Equals("ROUNDED"))
            {
                businessRule.getComponentValue("CL_PWN_0021_APRCALCTODEC", ref sComponentValue);
                underwritePawnLoanVO.APR = Math.Round(underwritePawnLoanVO.APR, Convert.ToInt32(sComponentValue));
            }
            else
            {
                businessRule.getComponentValue("CL_PWN_0025_APRCALCRNDFAC", ref sComponentValue);
            }

            return(_PawnLoan);
        }