Exemplo n.º 1
0
        /// <summary>
        /// This method returns string of accepted currencies of funding source
        /// </summary>
        /// <param name="pkFundingSourceID">pkFundingSourceID</param>
        /// <returns></returns>
        public string GetAllAcceptedCurrenciesofSource(int pkFundingSourceID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    string            strAcceptedCurrencies = String.Empty;
                    L_CurrencyValueBO lCurrValueBO          = new L_CurrencyValueBO();

                    var sourceAcceptedCurrRepo =
                        new FundingSourceAcceptedCurrencyRepository(new EFRepository <FundingSourceAcceptedCurrency>(), unitOfWork);

                    ObjectSet <FundingSourceAcceptedCurrency> acceptedCurrObjSet =
                        ((CurrentDeskClientsEntities)sourceAcceptedCurrRepo.Repository.UnitOfWork.Context).FundingSourceAcceptedCurrencies;

                    //Get all currencies
                    var acceptedCurrencies = acceptedCurrObjSet.Where(curr => curr.FK_FundingSourceID == pkFundingSourceID && curr.IsDeleted == false).ToList();

                    //Make string of currencies comma separated
                    foreach (var curr in acceptedCurrencies)
                    {
                        strAcceptedCurrencies += lCurrValueBO.GetCurrencySymbolFromID((int)curr.FK_LCurrencyValueID) + ", ";
                    }

                    return(strAcceptedCurrencies.TrimEnd(' ').TrimEnd(','));
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(String.Empty);
            }
        }