123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.SystemView;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.DataLogic.SystemDAL
- {
- public class FunctionDAL
- {
- public FunctionCodeRepository FunctionCodeRepository { get; set; }
- public RoleRepository RoleRepository { get; set; }
- public IQueryable<FunctionCodeView> GetAllFunctionCodeView()
- {
- var q = (from fc in FunctionCodeRepository.Entities
- select new FunctionCodeView
- {
- FunctionCode = fc.FunctionCode,
- FunctionName = fc.FunctionName,
- ParentFunctionCode = fc.ParentFunctionCode,
- OrderNo = fc.OrderNo
- }
- ).Distinct();
- return q;
- }
- public IQueryable<FunctionCodeView> GetSelectedFunctionCodeViewByRole(Expression<Func<Sys_Role, bool>> exp)
- {
- var q = (from r in RoleRepository.GetList(exp)
- from fc in r.Sys_FunctionCode
- select new FunctionCodeView
- {
- FunctionCode = fc.FunctionCode,
- FunctionName = fc.FunctionName,
- ParentFunctionCode = fc.ParentFunctionCode,
- OrderNo = fc.OrderNo
- }
- ).Distinct();
- return q;
- }
- }
- }
|