// GET: CustomerViews/Details/5 public PartialViewResult GetCustomers(string searchString, int sortType) { PersonSort sort = TempData["sort"] as PersonSort; TempData.Keep(); if (searchString != "`") { sort.SearchString = searchString; } sort.GetSort(sortType); TempData["sort"] = sort; TempData.Keep(); List <CustomerView> customers = new List <CustomerView>(); if (!String.IsNullOrEmpty(sort.SearchString)) { foreach (var c in serviceCustomers.Sort(serviceCustomers.CustomerSearch(sort.SearchString), sort.Sort, sort.GetOrder())) { customers.Add(new CustomerView(c)); } } else { foreach (var c in serviceCustomers.Sort(serviceCustomers.GetCustomers(), sort.Sort, sort.GetOrder())) { customers.Add(new CustomerView(c)); } } return(PartialView(customers)); }
public PersonRazorModel(IPersonService CurrentService, SchoolContext context, IMapper Mapper) { this.CurrentService = CurrentService; this.context = context; mapper = Mapper; PersonSort.Initialization(SortConditions); }
// GET: CustomerViews public ActionResult Index() { TempData["sort"] = new PersonSort(); TempData.Keep(); return(View("")); }