using Estsh.Core.Model.Result; using Estsh.Core.Models; using Estsh.Core.Repository.IRepositories; using Estsh.Core.Services.IServices; using Estsh.Core.Util; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:页面功能管理 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Services { public class PageFunctionService : BaseService, IPageFunctionService { private readonly IPageFunctionRepository repository; public PageFunctionService(IPageFunctionRepository _repository) : base(_repository) { repository = _repository; } /// /// 根据分页条件获取分页数据列表 /// public List getListByPage(ref Pager page, string menuName, String enabled) { string whereStr = " 1=1"; if (string.IsNullOrEmpty(menuName) == false) { whereStr += " and b.name like '%" + menuName + "%'"; } if (enabled != null && !enabled.Trim().Equals("")) { whereStr += " and a.enabled = '" + enabled + "'"; } return repository.getListByPage(ref page, whereStr); } public List GetWebMenuList(string name) { string where = string.Empty; if (string.IsNullOrEmpty(name) == false) { where = string.Format("name like '%{0}%'", name); } return repository.GetWebMenuList(where); } public List GetOpType() { return repository.GetOpType(); } public List GetFunctionByRuid(string ruid) { List dt = null; if (string.IsNullOrEmpty(ruid) == false) { string where = string.Format("ruid='{0}'", ruid); dt = repository.GetFunction(where); } return dt; } public bool SaveOp(string where, SysProgramFunOp paramsList) { return repository.SaveOp(where, paramsList); } public bool AddOp(SysProgramFunOp paramsList) { return repository.AddOp(paramsList); } public bool ExitOp(string program, string fun_name, string grid_name, string op_name) { string where = string.Format(" program='{0}' and fun_name='{1}' and grid_name='{2}' and op_name='{3}'", program, fun_name, grid_name, op_name); return repository.ExitOp(where); } public bool DeleteByRuid(string ruidStr) { string where = string.Format("ruid in ({0})", ruidStr); return repository.Delete(where); } /// /// 启用 /// /// /// public int EnableData(String ids) { ids = ids.Substring(0, ids.Length - 1); return this.repository.EnableData(ids); } /// /// 禁用 /// /// /// public int DisableData(String ids) { ids = ids.Substring(0, ids.Length - 1); return this.repository.DisableData(ids); } } }