示例#1
0
        public List <BankAccountTypeModel> GetAllBankAccountType(BaseViewModel model)
        {
            List <BankAccountTypeModel> bankAccList     = new List <BankAccountTypeModel>();
            BankAccountTypeModel        BankAccountType = new BankAccountTypeModel();

            List <Master_BankAccountType> bankAccountList = _bankAccountRepository.GetAllBankAccountType();

            try
            {
                if (bankAccountList != null)
                {
                    bankAccountList.ForEach(a => {
                        BankAccountType = Mapper.Map <Master_BankAccountType, BankAccountTypeModel>(a);

                        BankAccountType.Name = Utility.GetPropertyValue(BankAccountType, "Name", model.CurrentCulture) == null ? string.Empty :
                                               Utility.GetPropertyValue(BankAccountType, "Name", model.CurrentCulture).ToString();
                        bankAccList.Add(BankAccountType);
                    });
                }
            }
            catch (Exception ex) { ex.Message.ToString(); }

            bankAccList.Sort(CompareBankAccountTypeByName);
            return(bankAccList);
        }