總疏文
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
/// <summary>
|
||||
/// companyController 的摘要描述
|
||||
/// </summary>
|
||||
[ezAuthorize]
|
||||
public class companyController : BaseApiController
|
||||
{
|
||||
public companyController()
|
||||
{
|
||||
//
|
||||
// TODO: 在這裡新增建構函式邏輯
|
||||
//
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/hrs/basic/GetCompanys")]
|
||||
public IHttpActionResult GetCompanys([FromBody] Model.hr_company comp, int page, int pageSize = 10,
|
||||
string sortBy = "", bool sortDesc = false)
|
||||
{
|
||||
var qry = _db.hr_company.AsQueryable();
|
||||
|
||||
|
||||
var count = qry.Count();
|
||||
var qryList = (pageSize > 0) ? qry.ToPagedList(page, pageSize).ToList() : qry.ToList();
|
||||
|
||||
var ret = new
|
||||
{
|
||||
list = qryList.Select(x => new
|
||||
{
|
||||
x.company_id,
|
||||
x.name,
|
||||
x.parent_id,
|
||||
x.super_visor,
|
||||
x.contactor
|
||||
}),
|
||||
count = count
|
||||
};
|
||||
|
||||
return Ok(ret);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user