public ActionResult ProcessDataTables() { string echo = Request.Params["sEcho"].ToString(); string iColumns = Request.Params["iColumns"].ToString(); string sColumns = Request.Params["sColumns"].ToString(); int iDisplayStart = int.Parse(Request.Params["iDisplayStart"].ToString()); int iDisplayLength = int.Parse(Request.Params["iDisplayLength"].ToString()); string mDataProp_0 = Request.Params["mDataProp_0"].ToString(); string sSearch = Request.Params["sSearch"].ToString(); string iSortCol_0 = Request.Params["iSortCol_0"].ToString(); string sSortDir_0 = Request.Params["sSortDir_0"].ToString(); string iSortingCols = Request.Params["iSortingCols"].ToString(); string bSortable_0 = Request.Params["bSortable_0"].ToString(); int regExibir = iDisplayLength; int startExibir = iDisplayStart; IList<ClienteViewModel> clientesCadastrados = RepositoryFake.GetClientesCadastrados(); IList<ClienteViewModel> clientesFiltrados = clientesCadastrados.Where(x => (x.Id.ToString().Contains(sSearch.ToUpper())) || (x.Nome.ToUpper().Contains(sSearch.ToUpper())) || (x.Sexo.ToUpper().Contains(sSearch.ToUpper())) || (x.Estado.ToUpper().Contains(sSearch.ToUpper())) || (x.Idade.ToString().Contains(sSearch.ToUpper()))).ToList<ClienteViewModel>(); JQueryDataTableHelper<ClienteViewModel> jQueryDataTable = new JQueryDataTableHelper<ClienteViewModel>(clientesFiltrados, clientesCadastrados.Count); return Json(jQueryDataTable.GetDataTablesObject(Request),JsonRequestBehavior.AllowGet); }
public ActionResult Search() { LinqTable optHelper = new LinqTable(); var result = optHelper.BlogHelper(); result = result.Where(x => x.Categore == "成品展覽"); int totalLen = Convert.ToInt16(result.Count()); JQueryDataTableResponse <ArticleViewModel> jqDataTableRs = JQueryDataTableHelper <ArticleViewModel> .GetResponse(1, totalLen, totalLen, result.ToList()); return(Json(jqDataTableRs)); }
public ActionResult Search() { var Emp = EmployeePageService.GetAll(); var result = (from emp in Emp select new Employee { Name = emp.Name, Account = emp.Account }).ToList(); int totalLen = Convert.ToInt16(result.Count()); JQueryDataTableResponse <Employee> jqDataTableRs = JQueryDataTableHelper <Employee> .GetResponse(1, totalLen, totalLen, result.ToList()); return(Json(jqDataTableRs)); }
public ActionResult Search(string Lang) { var blog = BloggerService.GetAll(); var articles = ArticleService.GetAll(); LinqTable optHelper = new LinqTable(); var result = optHelper.ArtHelper(); result = result.Where(x => x.Categore == "服務頁"); if (!String.IsNullOrEmpty(Lang)) { result = result.Where(i => i.Id == int.Parse(Lang)).ToList(); } int totalLen = Convert.ToInt16(result.Count()); JQueryDataTableResponse <ArticleViewModel> jqDataTableRs = JQueryDataTableHelper <ArticleViewModel> .GetResponse(1, totalLen, totalLen, result.ToList()); return(Json(jqDataTableRs)); }
public ActionResult Search() { var a = DateTime.Now.ToString("yyyy-MM-dd"); var contact = ContactService.GetAll(); var result = (from b in contact select new Contact { Id = b.Id, Name = b.Name, Phone = b.Phone, Email = b.Email, Service = b.Service, Time = DBNull.Value.Equals(b.CreateTime) ? "" :ToYMD(b.CreateTime), Memo = b.Memo }).ToList(); int totalLen = Convert.ToInt16(result.Count()); JQueryDataTableResponse <Contact> jqDataTableRs = JQueryDataTableHelper <Contact> .GetResponse(1, totalLen, totalLen, result.ToList()); return(Json(jqDataTableRs)); }