Esempio n. 1
0
 public AdminController(ILogger <AdminController> logger, ISysAdminService adminService, LoginModel.LoginModel loginModel)
 {
     _logger = logger;
     ///测试IOC
     _adminService = adminService;
     _loginModel   = loginModel;
 }
 public SysAdminController(ILogger <SysAdminController> logger, ISysAdminService sysAdminService, IApiLogRepository apiLogRepository, IUserRepository userRepository)
 {
     _logger           = logger;
     _sysAdminService  = sysAdminService;
     _apiLogRepository = apiLogRepository;
     _userRepository   = userRepository;
 }
Esempio n. 3
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (!httpContext.User.Identity.IsAuthenticated)
            {
                return(false);
            }
            //根据用户角色
            string actionName     = httpContext.Request.RequestContext.RouteData.Values["action"].ToString().ToLower();
            string controllerName = httpContext.Request.RequestContext.RouteData.Values["controller"].ToString().ToLower();
            string httpMethod     = httpContext.Request.HttpMethod.ToLower();


            ISysAdminService sysAdminService = IOC.Resolve <ISysAdminService>();
            //判断是否超级管理员
            var sysAdmin = sysAdminService.Get(m => m.IsAdmin && m.UserName == httpContext.User.Identity.Name);

            if (sysAdmin != null && sysAdmin.Id > 0)
            {
                return(base.AuthorizeCore(httpContext));
            }

            ISysAdminRoleService sysAdminRoleService = IOC.Resolve <ISysAdminRoleService>();
            var entity = sysAdminRoleService.Get(m => m.SysRole.SysRoleMenu.Any(w => w.SysMenu.Controller.ToLower() == controllerName && w.SysMenu.Action.ToLower() == actionName));

            if (entity != null && entity.Id > 0)
            {
                return(base.AuthorizeCore(httpContext));
            }

            return(false);
        }
Esempio n. 4
0
 public DashboardController(IAnalysisService analysisService,
                            IEmployeeService employeeService, ISysAdminService sysAdminService)
 {
     _analysisService = analysisService;
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
 }
Esempio n. 5
0
 public ProjectController(IEmployeeService employeeService,
                          ISysAdminService sysAdminService, IProjectService projectService)
 {
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
     _projectService  = projectService;
 }
Esempio n. 6
0
 public NoticeController(
     ISysAdminService adminService,
     ISysNoticeService noticeService)
 {
     _adminService  = adminService;
     _noticeService = noticeService;
 }
Esempio n. 7
0
 public LoginController(ISysAdminService adminService,
                        ISysLogService logService,
                        IHttpContextAccessor httpContextAccessor)
 {
     _adminService        = adminService;
     _logService          = logService;
     _httpContextAccessor = httpContextAccessor;
 }
Esempio n. 8
0
 public AdminController(ISysAdminService adminService, ISysLogService logService, ICacheService cacheService,
                        ICmsSiteService siteService)
 {
     _adminService = adminService;
     _logService   = logService;
     _cacheService = cacheService;
     _siteService  = siteService;
 }
Esempio n. 9
0
 public HomeController(ISysSiteService siteService,
                       ISysAdminService adminService,
                       ISysMenuService sysMenuService,
                       ISysLogService sysLogService,
                       IHttpContextAccessor httpContextAccessor)
 {
     _siteService         = siteService;
     _adminService        = adminService;
     _sysMenuService      = sysMenuService;
     _sysLogService       = sysLogService;
     _httpContextAccessor = httpContextAccessor;
 }
Esempio n. 10
0
 public AdminController(
     ISysAdminService adminService,
     ISysLogService logService,
     IConfiguration config,
     IDistributedCache cache,
     ICmsShopService shop) : base(cache)
 {
     _adminService = adminService;
     _logService   = logService;
     _config       = config;
     _cache        = cache;
     _shop         = shop;
 }
Esempio n. 11
0
 public AuthorityController(ISysActionService sysActionService,
                            ISysAdminService sysAdminService,
                            ISysRoleService sysRoleService,
                            ISysRoleActionService sysRoleActionService,
                            ISysAdminRoleService sysAdminRoleService,
                            ISysMenuService sysMenuService)
 {
     _sysActionService     = sysActionService;
     _sysAdminService      = sysAdminService;
     _sysRoleService       = sysRoleService;
     _sysRoleActionService = sysRoleActionService;
     _sysAdminRoleService  = sysAdminRoleService;
     _sysMenuService       = sysMenuService;
 }
Esempio n. 12
0
        internal static async Task WriteExcelReference(MemoryStream stream, ISysAdminService sysAdminService)
        {
            IWorkbook   workbook   = new XSSFWorkbook();
            IDataFormat dataformat = workbook.CreateDataFormat();
            ICellStyle  dateStyle  = workbook.CreateCellStyle();

            dateStyle.DataFormat = dataformat.GetFormat("yyyy-MM-dd");

            ISheet orgSheet  = workbook.CreateSheet("Organizations");
            ISheet specSheet = workbook.CreateSheet("Specialties");

            FullSheet <Entity.Organization>(await sysAdminService.GetOrganiztions(), orgSheet, dateStyle);
            FullSheet <Entity.Reference>(await sysAdminService.GetReferences(Entity.ReferenceTypeEnum.Specialty), specSheet, dateStyle);

            workbook.Write(stream);
        }
Esempio n. 13
0
 public SystemController(ISysAdminService sysAdminService,
                         IUserManager userManager, IProjectService projectService,
                         IEmployeeService employeeService, IOptionsSnapshot <List <ExcelMap> > options)
 {
     _sysAdminSvc     = sysAdminService;
     _userManager     = userManager;
     _projectService  = projectService;
     _employeeService = employeeService;
     if (options != null)
     {
         _excelMappings = new Dictionary <string, ExcelMap>();
         foreach (var map in options.Value)
         {
             if (!_excelMappings.ContainsKey(map.EntityName))
             {
                 _excelMappings.Add(map.EntityName, map);
             }
         }
     }
 }
Esempio n. 14
0
 public AdminController(ISysAdminService sysAdminService, ISysRoleService sysRoleService, IWebHostEnvironment environment)
 {
     _sysAdminService = sysAdminService;
     _sysRoleService  = sysRoleService;
     _environment     = environment;
 }
Esempio n. 15
0
 public AgentDetailModel(ICmsAgentService agent, ICmsLevelService level, ISysAdminService admin)
 {
     _agent = agent;
     _admin = admin;
     _level = level;
 }
 public AdminController(ISysAdminService adminService, ISysLogService logService)
 {
     _adminService = adminService;
     _logService   = logService;
 }
Esempio n. 17
0
 public WeatherForecastController(ISysAdminService adminService
                                  , IBuilderTool toolService)
 {
     _adminService = adminService;
     _toolService  = toolService;
 }
Esempio n. 18
0
 public EmployeeController(IEmployeeService employeeService, ISysAdminService sysAdminService)
 {
     _employeeService = employeeService;
     _sysAdminService = sysAdminService;
 }
Esempio n. 19
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger
                                  , ISysAdminService adminService)
 {
     _logger       = logger;
     _adminService = adminService;
 }
Esempio n. 20
0
 public IndexModel(ICmsSiteService siteService, ISysAdminService adminService)
 {
     _siteService  = siteService;
     _adminService = adminService;
 }
Esempio n. 21
0
 public LoginModel(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Esempio n. 22
0
 public ValuesController(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Esempio n. 23
0
 public DefaultModel(ICmsSiteService siteService, ISysAdminService adminService)
 {
     _siteService  = siteService;
     _adminService = adminService;
 }
Esempio n. 24
0
 public CmsAgentService(ISysAdminService sysAdmin, ISysPermissionsService sysPermissions, IConfiguration config) : base(config)
 {
     this.sysAdmin       = sysAdmin;
     this.sysPermissions = sysPermissions;
 }
Esempio n. 25
0
 public RoleController(ISysRoleService roleService, ISysAdminService adminService)
 {
     _roleService  = roleService;
     _adminService = adminService;
 }
Esempio n. 26
0
 public AdminController(ISysAdminService adminService)
 {
     _adminService = adminService;
 }
Esempio n. 27
0
 public SysAdminController(ISysAdminService sysAdminService)
 {
     _sysAdminService = sysAdminService;
 }
Esempio n. 28
0
 public AccountController(ISysAdminService sysAdminService)
 {
     this.sysAdminService = sysAdminService;
 }
Esempio n. 29
0
 public AdminModifyModel(ISysAdminService adminService)
 {
     _adminService = adminService;
 }