예제 #1
0
        // 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));
        }
예제 #2
0
 public PersonRazorModel(IPersonService CurrentService,
                         SchoolContext context,
                         IMapper Mapper)
 {
     this.CurrentService = CurrentService;
     this.context        = context;
     mapper = Mapper;
     PersonSort.Initialization(SortConditions);
 }
예제 #3
0
 // GET: CustomerViews
 public ActionResult Index()
 {
     TempData["sort"] = new PersonSort();
     TempData.Keep();
     return(View(""));
 }