Esempio n. 1
0
        public ViewResult Index(string sortOrder, string currentFilter, string searchString, int?page)
        {
            ViewBag.CurrentSort = sortOrder;

            ViewBag.NameSortParm = string.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";


            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }


            ViewBag.CurrentFilter = searchString;


            var clientes = from c in process.ListarTodos() select c;

            if (!string.IsNullOrEmpty(searchString))
            {
                clientes = clientes.Where(s => s.TipoServicio.Nombre.Contains(searchString));
            }

            switch (sortOrder)
            {
            case "name_desc":
                clientes = clientes.OrderByDescending(s => s.TipoServicio.Nombre);
                break;

            //case "Date":
            //    clientes = clientes.OrderBy(s => s.Id);
            //    break;
            default:
                clientes = clientes.OrderBy(s => s.FechaDesde);
                break;
            }


            //return View(clientes.ToList());
            int pageSize   = 10;
            int pageNumber = (page ?? 1);

            return(View(clientes.ToPagedList(pageNumber, pageSize)));
        }
Esempio n. 2
0
        public List <Precio> ListarTodos()
        {
            List <Precio>  result = default(List <Precio>);
            IPrecioService proxy  = _precioService;

            try
            {
                result = proxy.ListarTodos();
            }
            catch (FaultException fex)
            {
                throw new ApplicationException(fex.Message);
            }
            return(result);
        }
Esempio n. 3
0
 public List <Precio> ListarTodos()
 {
     return(PrecioServices.ListarTodos());
 }