You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

74 lines
2.7 KiB

using EasyBL.WebApi.Message;
using Entity.Sugar;
using SqlSugar;
using SqlSugar.Base;
using System;
namespace EasyBL.WEBAPP.SYS
{
public class JobtitleMaintain_QryService : ServiceBase
{
#region 職稱管理(分頁查詢)
/// <summary>
/// 職稱管理(分頁查詢)
/// </summary>
/// <param name="i_crm"></param>
/// <returns></returns>
public ResponseMessage QueryPage(RequestMessage i_crm)
{
ResponseMessage rm = null;
string sMsg = null;
var db = SugarBase.GetIntance();
try
{
do
{
var pml = new PageModel
{
PageIndex = _fetchInt(i_crm, @"pageIndex"),
PageSize = _fetchInt(i_crm, @"pageSize")
};
var iPageCount = 0;
var sSortField = _fetchString(i_crm, @"sortField");
var sSortOrder = _fetchString(i_crm, @"sortOrder");
var sJobtitleID = _fetchString(i_crm, @"JobtitleID");
var sJobtitleName = _fetchString(i_crm, @"JobtitleName");
var sEffective = _fetchString(i_crm, @"Effective");
var bExcel = _fetchBool(i_crm, @"Excel");
pml.DataList = db.Queryable<OTB_SYS_Jobtitle>()
.Where(x => x.OrgID == i_crm.ORIGID && x.JobtitleID.Contains(sJobtitleID) && x.JobtitleName.Contains(sJobtitleName) && sEffective.Contains(x.Effective))
.OrderBy(sSortField, sSortOrder)
.ToPageList(pml.PageIndex, bExcel ? 100000 : pml.PageSize, ref iPageCount);
pml.Total = iPageCount;
rm = new SuccessResponseMessage(null, i_crm);
if (bExcel)
{
}
else
{
rm.DATA.Add(BLWording.REL, pml);
}
} while (false);
}
catch (Exception ex)
{
sMsg = Util.GetLastExceptionMsg(ex);
LogAndSendEmail(sMsg + "Params:" + JsonToString(i_crm), ex, i_crm.ORIGID, i_crm.USERID, nameof(JobtitleMaintain_QryService), "", "QueryPage(職稱管理(分頁查詢))", "", "", "");
}
finally
{
if (null != sMsg)
{
rm = new ErrorResponseMessage(sMsg, i_crm);
}
}
return rm;
}
#endregion 職稱管理(分頁查詢)
}
}