public LiveHubController(Ilog log)
        {
            this.log = log;
            HostingEnvironment.RegisterObject(this);
            this.unitOfWork = new EFUnitOfWork(new DatabaseContext());
            this.hub = GlobalHost.ConnectionManager.GetHubContext<LiveHub>();
            this.entityChangeProvider = new EntityEventsProvider();

            this.entityChangeProvider.EntityChange += EntityChangeProvider_EntityChange;
            this.entityChangeProvider.Start();
        }
Пример #2
0
        public void Configuration(IAppBuilder app)
        {
            //http://www.zpqrtbnk.net/posts/appdomains-threads-cultureinfos-and-paracetamol
            SanitizeThreadCulture(app);
            HubConfiguration config = new HubConfiguration();
            config.EnableDetailedErrors = true;

            app.MapSignalR(config);

            log = new DebugLog();
            System.Data.Entity.Database.SetInitializer(new DatabaseInitializer());
            liveHubController = new LiveHubController(log);
        }
Пример #3
0
 public landingController()
 {
     _iLog = Log.GetInstance;
 }
Пример #4
0
 public LoginController()
 {
     _iLog = Log.GetInstance;
 }
 public MVCHeadAccountController()
 {
     _iLog = Log.GetInstance;
 }
 public ChatMessagesController(Ilog log)
 {
     unitOfWork = new ChangeTrackingEFUnitOfWork(new DatabaseContext(), log);
 }
Пример #7
0
 public PermissionController(IMapper imap_, Ilog logger)
 {
     _logger = logger;
     prm     = new PermissionManager(imap_);
 }
Пример #8
0
 public AccountController(IMapper imap_, Ilog logger)
 {
     _logger = logger;
     acc     = new AccountManager(imap_);
 }
Пример #9
0
 public EmailController()
 {
     _iLog = Log.GetInstance;
 }
Пример #10
0
 public UserInfoController()
 {
     _iLog = Log.GetInstance;
 }
Пример #11
0
 public StationControl(IDoor door, IChargerControl chargeControl, IRfIdReader rfIdReader, Ilog log, IDisplay display)
 {
     _door          = door;
     _chargeControl = chargeControl;
     _rfIdReader    = rfIdReader;
     _display       = display;
     _log           = log;
     _state         = LadeskabState.Available;
     _door.DoorStateChangedEvent   += HandleDoorStateChangedEvent;
     _rfIdReader.RfIdDetectedEvent += HandleRfidDetectedEvent;
 }
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            Ilog    _logger     = context.HttpContext.RequestServices.GetService(typeof(Ilog)) as Ilog;
            IMapper _imapper    = context.HttpContext.RequestServices.GetService(typeof(IMapper)) as IMapper;
            string  username    = "******";
            string  objIdentity = context.HttpContext.Session.GetString(Helpers.SessionKeyUser.Key);

            if (!string.IsNullOrEmpty(objIdentity))
            {
                username = JsonConvert.DeserializeObject <Models.UserSessionModel>(objIdentity).username;
            }

            _logger.SetLogInfo(username, context.HttpContext.Request.Path.Value);
            _imapper.user = username;
            _imapper.host = context.HttpContext.Connection.RemoteIpAddress.ToString();

            //when controller not allowanonymous
            if (!context.Filters.Any(item => item is IAllowAnonymousFilter))
            {
                bool isValiduser = false;
                if (!string.IsNullOrEmpty(objIdentity))
                {
                    ExecResult      exec         = new ExecResult();
                    CheckisAdminRPO userRoleRPOs = new CheckisAdminRPO(_imapper);
                    userRoleRPOs.Conditions(nameof(TuserRole.Username), Operator.Equals(username));
                    userRoleRPOs.ReadList(ref exec);
                    //if not success check administrator
                    if (!exec.Success)
                    {
                        isValiduser = false;
                    }
                    //if not admin then check allowed actionController
                    else if (userRoleRPOs.Result.AffectedRow == 0)
                    {
                        ActPermissionVMRPO actiPermissionRPO = new ActPermissionVMRPO(_imapper);
                        string             controllerName    = (string)context.RouteData.Values["controller"] + "Controller";
                        string             actionName        = (string)context.RouteData.Values["action"];
                        Conditions         cnd = new Conditions();
                        cnd.AddFilter(nameof(ActPermissionVM.Username), Operator.Equals(username));
                        cnd.AddFilter(nameof(ActPermissionVM.ControllerName), Operator.Equals(controllerName));
                        cnd.AddFilter(nameof(ActPermissionVM.ActionName), Operator.Equals(actionName));
                        cnd.AddFilter(nameof(ActPermissionVM.IsAllowed), Operator.Equals("1"));
                        actiPermissionRPO.Conditions(cnd);
                        if (actiPermissionRPO.ReadList(ref exec))
                        {
                            List <ActPermissionVM> tym = actiPermissionRPO.Result.Collection;
                            isValiduser = actiPermissionRPO.Result.AffectedRow > 0;
                        }
                    }
                    else
                    {
                        isValiduser = true; //is admin
                    }
                }

                if (!isValiduser)
                {
                    _logger.WARNING("Not Authorized");
                    context.Result = new ViewResult
                    {
                        ViewName = "../Account/NotAuthorized"
                    };
                }
            }
        }
Пример #13
0
 public ErrorController()
 {
     _iLog = Log.GetInstance;
 }
Пример #14
0
 public GenrateInvoiceController()
 {
     _iLog = Log.GetInstance;
 }
 public GetQuationCountController()
 {
     _iLog = Log.GetInstance;
 }
Пример #16
0
 public OrderController()
 {
     _iLog = Log.GetInstance;
 }
Пример #17
0
 public MVCProductController()
 {
     _iLog = Log.GetInstance;
 }
Пример #18
0
 public MVCComapnyController()
 {
     _iLog = Log.GetInstance;
 }
Пример #19
0
 public MVCClientController()
 {
     _iLog = Log.GetInstance;
 }
Пример #20
0
 public MvcPaymentTermController()
 {
     _iLog = Log.GetInstance;
 }
Пример #21
0
 public BaseController()
 {
     _ILog = Logger.Logger.GetInstance;
 }
Пример #22
0
 public MenuController(IMapper imap_, Ilog logger)
 {
     _logger = logger;
     mmgr    = new MenuManager(imap_);
 }
Пример #23
0
 public BankAccount(Ilog log)
 {
     this.log = log;
 }
Пример #24
0
 public RoleController(IMapper imap_, Ilog logger)
 {
     logger_ = logger;
     imap___ = imap_;
     rlm     = new RoleManager(imap_);
 }
Пример #25
0
 public ExceptionController()
 {
     _iLog = Log.GetInstance;
 }
Пример #26
0
 public LiveHub()
 {
     log = new DebugLog();
 }
Пример #27
0
 public HomeController()
 {
     _iLog = Log.GetInstance;
 }
 public EmailSender(IDbPortal DbPortal, Ilog log)
 {
     _DbPortal = DbPortal;
     _log      = log;
 }
 public HomeController(IMapper imap_, Ilog logger_)
 {
     this._logger = logger_;
     this.imap    = imap_;
 }