Esempio n. 1
0
        // GET: clients
        public ActionResult Index(string razonsocial, int page = 1)
        {
            ClientVMIndex model = new ClientVMIndex {
                razonSocial = razonsocial, page = page
            };

            try
            {
                IEnumerable <ListClient> list = _repo.ClientList(model.razonSocial);

                model.list       = list.OrderByDescending(o => o.id).Skip((page - 1) * _pageSize).Take(_pageSize);
                model.pagingInfo = new PagingInfo
                {
                    CurrentPage  = page,
                    ItemsPerPage = _pageSize,
                    TotalItems   = list.Count()
                };
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", "Se produjo un error, en caso de persistir, ponerse en contacto con el Administrador.");
            }

            return(View(model));
        }