Ejemplo n.º 1
0
        public List <ClientListViewModel> ListClients(string q)
        {
            var clientRepository = new ClientRepository();

            IEnumerable <Client>       clients = clientRepository.FindByName(q).OrderByDescending(n => n.ID);
            List <ClientListViewModel> vmList  = new List <ClientListViewModel>();

            foreach (Client c in clients)
            {
                var viewModel = new ClientListViewModel();
                viewModel.client = c;
                vmList.Add(viewModel);
            }
            return(vmList);
        }
Ejemplo n.º 2
0
        public List <ClientListViewModel> ListClients()
        {
            var clientRepository = new ClientRepository();

            IEnumerable <Client>       clients = clientRepository.ListClients();
            List <ClientListViewModel> vmList  = new List <ClientListViewModel>();

            foreach (Client c in clients)
            {
                var viewModel = new ClientListViewModel();
                viewModel.client = c;
                vmList.Add(viewModel);
            }
            return(vmList);
        }