123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WMS.Info;
- using WMS.Util;
- namespace WMS.Core.ServiceCore.FeiXu
- {
- public class FxBaseItemCore
- {
- /// <summary>
- /// 获取列表数据
- /// <summary>
- /// <returns></returns>
- public IEnumerable<BASE_ITEM> GetList(string keyword)
- {
- try
- {
- return SysDbCore.GetDbCtx().Queryable<BASE_ITEM>().Where(it => it.F_isStop).WhereIF(!keyword.IsEmpty(), it => it.F_matNo.Contains(keyword) || it.F_matName.Contains(keyword) || it.F_matName.Contains(keyword)).ToList();
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 获取分页数据
- /// <summary>
- /// <returns></returns>
- public IEnumerable<BASE_ITEM> GetPageList(string keyword,Pagination pagination)
- {
- try
- {
- int count = 0;
- var db = SysDbCore.GetDbCtx().Queryable<BASE_ITEM>().WhereIF(!keyword.IsEmpty(), it => it.F_matNo.Contains(keyword) || it.F_matName.Contains(keyword) || it.F_matName1.Contains(keyword));
- List<BASE_ITEM> list = null;
- if (pagination.sord.ToUpper() == "ASC")
- {
- list = db.OrderBy(pagination.sidx).ToPageList(pagination.page, pagination.rows, ref count);
- }
- else
- {
- string orderstr = pagination.sidx + " desc";
- list = db.OrderBy(orderstr).ToPageList(pagination.page, pagination.rows, ref count);
- }
- pagination.records = count;
- return list;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 停用启用
- /// <summary>
- /// <returns></returns>
- public void IsEnable(int f_no,bool isStop)
- {
- try
- {
- SysDbCore.GetDbCtx().Updateable<BASE_ITEM>().SetColumns(it=>new BASE_ITEM { F_isStop= isStop }).Where(c => c.F_no == f_no).ExecuteCommand();
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- }
- }
|