Пример #1
0
 public GetListResult <OfferBM> GetListBySearchTerm(int clientId, string searchTerm)
 {
     //ModelMappings.Configure();
     try
     {
         var result = AutoMapper.Mapper.Map <List <OfferBM> >(_repository.GetListBySearch(clientId, searchTerm));
         return(ServiceResultsHelper.FillGetListResult(result));
     }
     catch (Exception ex)
     {
         return(ServiceResultsHelper.FillGetListResultForError <OfferBM>(ex));
     }
 }
Пример #2
0
 public GetListResult <WalletBM> GetListById(int clientId)
 {
     //ModelMappings.Configure();
     try
     {
         var result = Mapper.Map <List <WalletBM> >(_repository.GetWalletsByClientId(clientId));
         return(ServiceResultsHelper.FillGetListResult(result));
     }
     catch (Exception ex)
     {
         return(ServiceResultsHelper.FillGetListResultForError <WalletBM>(ex));
     }
 }
Пример #3
0
        public override GetListResult <CurrencyInfoBM> GetList()
        {
            try
            {
                //ModelMappings.Configure();

                var result = Mapper.Map <List <CurrencyInfoBM> >(_repository.GetList());
                return(ServiceResultsHelper.FillGetListResult(result));
            }
            catch (Exception ex)
            {
                return(ServiceResultsHelper.FillGetListResultForError <CurrencyInfoBM>(ex));
            }
        }
Пример #4
0
        public override GetListResult <OfferInfoBM> GetList(int key, string searchTerm)
        {
            try
            {
                //ModelMappings.Configure();
                if (!string.IsNullOrEmpty(searchTerm))
                {
                    var result = Mapper.Map <List <OfferInfoBM> >(_repository.GetList(key, searchTerm));
                    return(ServiceResultsHelper.FillGetListResult(result));
                }

                var resultEx = Mapper.Map <List <OfferInfoBM> >(_repository.GetList(key));
                return(ServiceResultsHelper.FillGetListResult(resultEx));
            }
            catch (Exception ex)
            {
                return(ServiceResultsHelper.FillGetListResultForError <OfferInfoBM>(ex));
            }
        }