public ActionResult Index(CustomerContactsQueryViewModel data = null) { CustomerContactsQueryViewModel result = new CustomerContactsQueryViewModel(); result.Contacts = ContactsRepo.Search(data.Query, data.Paging, data.Sort); result.Paging.Count = ContactsRepo.SearchCount(data.Query); result.Paging.Take = data.Paging.Take; result.Query = data.Query; result.BatchEdit = data.BatchEdit; return(View(result)); }
// GET: 客戶聯絡人 public ActionResult Index(客戶聯絡人QueryOption query) { var 客戶聯絡人 = concatRepository.Search(query.Keyword, query.Job, query.CustomerName) .Select(concat => new 客戶聯絡人ViewModel() { Id = concat.Id, 客戶Id = concat.客戶Id, 姓名 = concat.姓名, 客戶名稱 = concat.客戶資料.客戶名稱, Email = concat.Email, 電話 = concat.電話, 手機 = concat.手機, 職稱 = concat.職稱 }) .OrderBy(query.GetSortString()) .ToPagedList(query.Page, query.GetPageSize()); ViewBag.QueryOption = query; return(View(客戶聯絡人)); }