1代码合并
This commit is contained in:
@@ -352,33 +352,18 @@ namespace WebAPI.Controllers
|
||||
/// <param name="trainTypeId">培训类型ID(可为空)</param>
|
||||
/// <param name="pageIndex">分页</param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, int pageIndex, string departIds="", string strParam="", string InTime="")
|
||||
public Model.ResponeData getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId, int pageIndex)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(projectId))
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, trainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
int pageCount = getDataList.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
var getDataList = APIPersonService.getTrainingPersonListByDepartAndTrainTypeId(unitIds, departIds, trainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
int pageCount = getDataList.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = getDataList.OrderBy(u => u.UnitName).ThenBy(u => u.PersonName).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList(); ////200 ->Funs.PageSize
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
getDataList = getDataList.OrderBy(u => u.UnitName).ThenBy(u => u.PersonName).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList(); ////200 ->Funs.PageSize
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(projectId, unitIds, workPostIds, departIds, trainTypeId, InTime, strParam).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList();
|
||||
|
||||
int pageCount = getDataList.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = getDataList.OrderBy(u => u.UnitName).ThenBy(u => u.PersonName).Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList(); ////200 ->Funs.PageSize
|
||||
}
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1141,6 +1126,6 @@ namespace WebAPI.Controllers
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user