コード例 #1
0
 public ActionResult GetCompany(string q, int page_limit, int page, int companyType)
 {
     var CompanySvc = new CompanyService();
     int from = (page - 1) * page_limit;
     int to = from + page_limit - 1;
     var company = CompanySvc.GetCompanyByRange(from, to, q, companyType).Select(o => new Dictionary<string, object> {
         {"id", o.Id},
         {"text", o.Name}
     }).ToList();
     int count = CompanySvc.GetAllCount(companyType, q);
     var result = new Dictionary<string, object>{
         {"total",count},
         {"company",company}
     };
     return Json(result);
 }