123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using DllEapEntity.Rms;
- using DllEapEntity.Dtos;
- using Microsoft.AspNetCore.Mvc;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Cksoft.Data;
- using Cksoft.Data.Repository;
- using DllEapDal;
- using Cksoft.Unity;
- using Cksoft.Unity.Log4NetConfig;
- using System.Linq;
- using DllEapEntity;
- namespace WebApplet.Controllers
- {
- [Route("eap/api/[controller]/[action]")]
- public class RmsTProcessController : ControllerBase
- {
- [HttpGet]
- public LayuiModel<TProcess> Get(string filter, int pageIndex = 1, int pageSize = 10, string sortField = "ID", string sortOrder = "ascend")
- {
- if (sortOrder == "descend")
- {
- sortOrder = "desc";
- }
- else
- {
- sortOrder = "asc";
- }
- int start, end;
- start = (pageIndex - 1) * pageSize + 1;
- end = start + pageSize;
- using (IDatabase db = DbFactory.Base("eapslave"))
- {
- db.BeginTrans();
- var dal = new TProcessDal(db);
- var total = dal.GetCount(filter);
- string errorinfo = string.Empty;
- var roles = dal.Get(start, pageSize, sortOrder, sortField, filter, errorinfo);
- return new LayuiModel<TProcess>
- {
- code = 1,
- count = total,
- data = roles,
- msg = ""
- };
- }
- }
- }
- }
|