private BusinessRuleVO GetBusinessRule(string sBusinessRule)
        {
            BusinessRuleVO _BusinessRule = null;

            if (GlobalDataAccessor.Instance.DesktopSession.PawnBusinessRuleVO.ContainsKey(sBusinessRule))
            {
                _BusinessRule = GlobalDataAccessor.Instance.DesktopSession.PawnBusinessRuleVO[sBusinessRule];
            }

            return(_BusinessRule);
        }
Beispiel #2
0
        private bool updateBusinessRuleComponent(List <string> busRules, ref Dictionary <string, BusinessRuleVO> bvoHierarchy, ref PawnRule p)
        {
            if (p == null || busRules == null || bvoHierarchy == null)
            {
                return(false);
            }
            string pawnRuleCompKey = p.RuleKey;

            foreach (string bRule in busRules)
            {
                string         curRule = bRule;
                BusinessRuleVO curBR   = bvoHierarchy[curRule];
                if (curBR == null || !curBR.ContainsKey(pawnRuleCompKey))
                {
                    continue;
                }

                BusinessRuleComponentVO bvo = curBR[pawnRuleCompKey];
                bvo.FromDate = p.FromDate;
                bvo.ToDate   = p.ToDate;
                //bvo.CheckLoanRange = p.CheckLoanRange;
                //bvo.CheckLoanAmount = p.CheckLoanAmount;
                bvo.Alias = p.Alias;

                switch (bvo.ValueType)
                {
                case BusinessRuleComponentVO.RuleValueType.FEES:
                    bvo.FeesValue.Alias.Code   = p.Alias;
                    bvo.FeesValue.ParamKeyCode = p.RuleKey;
                    bvo.FeesValue.Value        = p.RuleValue;
                    break;

                case BusinessRuleComponentVO.RuleValueType.INTEREST:
                    bvo.InterestValue.Alias.Code     = p.Alias;
                    bvo.InterestValue.InterestAmount = 0.0M;
                    bvo.InterestValue.InterestRate   = decimal.Parse(p.RuleValue);
                    bvo.InterestValue.MinAmount      = p.LoanAmountMin;
                    bvo.InterestValue.MaxAmount      = p.LoanAmountMax;
                    break;

                case BusinessRuleComponentVO.RuleValueType.PARAM:
                    bvo.ParamValue.Alias.Code = p.Alias;
                    bvo.ParamValue.Cacheable  = false;
                    bvo.ParamValue.Company    = "1";
                    bvo.ParamValue.Code       = p.RuleKey;
                    bvo.ParamValue.Value      = p.RuleValue;
                    break;
                }
            }
            return(true);
        }
 public TransferOutScrapsReport(List <TransferItemVO> t, List <IItem> s, BusinessRuleVO rule, DateTime shopDT, string userName, string transferNumber,
                                string catcoTransferType, string logPath, ReportObject.TransferReport reportObj, IPdfLauncher pdfLauncher)
     : base(pdfLauncher)
 {
     _mdseTransfer      = t;
     _trnsfrItems       = s;
     _shopDT            = shopDT;
     _userName          = userName;
     _transferNumber    = transferNumber;
     brMetalType        = rule;
     _catcoTransferType = catcoTransferType;
     _logPath           = logPath;
     _reportTitle       = String.Format("Transfer Out {0} Summary", _catcoTransferType);
     _reportObj         = reportObj;
 }
        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";
                    //}
                }
            }
        }
        //-------

        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);
        }