コード例 #1
0
        /// <summary>
        /// This method returns currency look up value from AccountCurrencyID
        /// </summary>
        /// <param name="accCurrID">accCurrID</param>
        /// <returns></returns>
        public string GetCurrencyLookUpValue(int accCurrID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accountCurrencyRepo =
                        new AccountCurrencyRepository(new EFRepository <AccountCurrency>(), unitOfWork);

                    ObjectSet <AccountCurrency> currencyObjSet =
                        ((CurrentDeskClientsEntities)accountCurrencyRepo.Repository.UnitOfWork.Context).AccountCurrencies;


                    return(currencyObjSet.Include("L_CurrencyValue").Where(curr => curr.PK_AccountCurrencyID == accCurrID).FirstOrDefault().L_CurrencyValue.CurrencyValue);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
コード例 #2
0
        /// <summary>
        /// This Function Will return all the selected Currency
        /// </summary>
        /// <param name="formID">formID</param>
        /// <param name="organizationID">organizationID</param>
        /// <returns></returns>
        public List <AccountCurrency> GetSelectedCurrency(int formID, int organizationID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var accountCurrencyRepo =
                        new AccountCurrencyRepository(new EFRepository <AccountCurrency>(), unitOfWork);

                    ObjectSet <AccountCurrency> currencyObjSet =
                        ((CurrentDeskClientsEntities)accountCurrencyRepo.Repository.UnitOfWork.Context).AccountCurrencies;


                    return(currencyObjSet.Where(accur => accur.FK_AccountFormTypeID == formID && accur.FK_OrganizationID == organizationID).Include("L_CurrencyValue").ToList());
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }