12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.SystemDAL;
- using EMIS.ViewModel.SystemView;
- using EMIS.Entities;
- namespace EMIS.CommonLogic.SystemServices
- {
- public class FunctionCodeServices : BaseServices, IFunctionCodeServices
- {
- public RoleDAL RoleDAL { get; set; }
- public FunctionDAL FunctionDAL { get; set; }
- public IList<FunctionCodeView> GetAllFunctionCodeViewList()
- {
- return FunctionDAL.GetAllFunctionCodeView().ToList();
- }
- public IList<FunctionCodeView> GetSelectFunctionCodeViewList(Guid roleID)
- {
- return FunctionDAL.GetSelectedFunctionCodeViewByRole(x => x.RoleID == roleID).ToList();
- }
- public void SaveAuthenization(Guid roleID, IList<string> functionCodeList)
- {
- var role = RoleDAL.RoleRepository.GetSingle(x => x.RoleID == roleID, (x => x.Sys_FunctionCode));
- var functionList = FunctionDAL.FunctionCodeRepository.GetList(x => functionCodeList.Contains(x.FunctionCode)).ToList();
- role.Sys_FunctionCode = new HashSet<Sys_FunctionCode>();
- functionList.ForEach(x => role.Sys_FunctionCode.Add(x));
- this.UnitOfWork.Commit();
- }
- }
- }
|