Example #1
0
 public ScriptController(LoggingService myLoggingService, PreferenceRepository myPreferenceRepository, ScriptRepository myScriptRepository,
                         ActionRepository myActionRepository)
 {
     _LoggingService       = myLoggingService;
     _PreferenceRepository = myPreferenceRepository;
     _ScriptRepository     = myScriptRepository;
     _ActionRepository     = myActionRepository;
 }
Example #2
0
 public HomeController(LoggingService myLoggingService, PreferenceRepository myPreferenceRepository, PlaneRepository myPlaneRepository,
                       ScriptRepository myScriptRepository, ExecutionRepository myExecutionRepository)
 {
     _LoggingService       = myLoggingService;
     _PreferenceRepository = myPreferenceRepository;
     _PlaneRepository      = myPlaneRepository;
     _ScriptRepository     = myScriptRepository;
     _ExecutionRepository  = myExecutionRepository;
 }
Example #3
0
 public void Init()
 {
     _LoggingService       = ServiceResolver.Resolve <LoggingService>();
     _PreferenceRepository = ServiceResolver.Resolve <PreferenceRepository>();
     _ExecutionRepository  = ServiceResolver.Resolve <ExecutionRepository>();
     _ActionRepository     = ServiceResolver.Resolve <ActionRepository>();
     _PlaneRepository      = ServiceResolver.Resolve <PlaneRepository>();
     _WcfService           = ServiceResolver.Resolve <WcfService>();
     _FileService          = ServiceResolver.Resolve <FileService>();
 }
Example #4
0
 public ExecutionController(LoggingService myLoggingService, PreferenceRepository myPreferenceRepository, ExecutionRepository myExecutionRepository,
                            WcfService myWcfService, ActionRepository myActionRepository, FileService myFileService, PlaneRepository myPlaneRepository)
 {
     _LoggingService       = myLoggingService;
     _PreferenceRepository = myPreferenceRepository;
     _ExecutionRepository  = myExecutionRepository;
     _ActionRepository     = myActionRepository;
     _PlaneRepository      = myPlaneRepository;
     _WcfService           = myWcfService;
     _FileService          = myFileService;
 }
Example #5
0
        public static UserApiResult GetUserLogged()
        {
            UserApiResult user = null;

            Preference preferenceUser = PreferenceRepository.GetByKey(Preference.USER_LOGGED_JSON);

            if (preferenceUser != null)
            {
                user = JsonConvert.DeserializeObject <UserApiResult>(preferenceUser.Value);
            }

            return(user);
        }
Example #6
0
        public void Init()
        {
            ServiceProvider = new ServiceCollection()
                              .AddLogging()
                              .AddSingleton(new LoggerFactory().AddSerilog(SerilogExtensions.Configure("CCSS.Preference.Repository.Tests.log")))
                              .AddTransient <IRepository <IPreferenceEvent>, PreferenceRepository>()
                              .AddSingleton <IConfigurationStore, GenericConfiguration>()
                              .AddMemoryCache()
                              .BuildServiceProvider();

            ConfigStore = ServiceProvider.GetRequiredService <IConfigurationStore>();
            PrefRepo    = ServiceProvider.GetRequiredService <IRepository <IPreferenceEvent> >() as PreferenceRepository;

            Assert.IsNotNull(ServiceProvider.GetService <ILoggerFactory>());
        }
Example #7
0
        public static void SaveUserLogged(UserApiResult user)
        {
            if (user != null)
            {
                UserApiResult actualUser = GetUserLogged();

                if (actualUser == null || !actualUser.ProfilePicture.Url.Equals(user.ProfilePicture.Url))
                {
                    string blobImageUrl = user.ProfilePicture != null ? user.ProfilePicture.Url : StringUtils.EMPTY;

                    user.ProfilePicture.Base64 = Functions.GetBase64ImageFromUrl(blobImageUrl);
                }
                else if (actualUser != null && actualUser.ContainsProfilePictureBase64())
                {
                    user.ProfilePicture = actualUser.ProfilePicture;
                }

                string jsonUser = JsonConvert.SerializeObject(user);

                PreferenceRepository.Save(Preference.USER_LOGGED_JSON, jsonUser);
            }
        }
Example #8
0
 public PlaneController(LoggingService myLoggingService, PreferenceRepository myPreferenceRepository, PlaneRepository myPlaneRepository)
 {
     _LoggingService       = myLoggingService;
     _PreferenceRepository = myPreferenceRepository;
     _PlaneRepository      = myPlaneRepository;
 }
Example #9
0
 public void Init()
 {
     myPreferenceRepository = ServiceResolver.Resolve <PreferenceRepository>();
 }