Ejemplo n.º 1
0
 public Program()
 {
     this.context          = new ApplicationDbContext();
     this.unitOfWork       = new UnitOfWork(context);
     this.systemParameters = new SystemParameters();
     this.logService       = new SmartInspectLogService();
 }
Ejemplo n.º 2
0
        public UniqueJobList(ISystemParameters systemParameters, ILogService logService, IUnitOfWork unitOfWork)
        {
            this.systemParameters = systemParameters;
            this.logService       = logService;
            this.unitOfWork       = unitOfWork;

            this.repository = this.unitOfWork.Repository <UniqueJob>();
        }
Ejemplo n.º 3
0
        public CommonMailService(ISystemParameters systemParameters, ILogService logService)
        {
            this.systemParameters = systemParameters;
            this.logService       = logService;

            this.mailProvider = new GMailProvider(systemParameters, logService);
            //this.mailProvider = new AliyunMailProvider(systemParameters, logService);
        }
Ejemplo n.º 4
0
        public CommonSmsService(ISystemParameters systemParameters, ILogService logService, IUnitOfWork unitOfWork)
        {
            this.systemParameters = systemParameters;
            this.logService       = logService;
            this.unitOfWork       = unitOfWork;
            this.tradeService     = new TradeService(unitOfWork, logService);

            this.uniqueJobList = new UniqueJobList(systemParameters, logService, unitOfWork);
        }
Ejemplo n.º 5
0
        public EfSmsBackgroundJob(ISystemParameters systemParameters, IUnitOfWork unitOfWork, ILogService logService)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");

            this.systemParameters = systemParameters;
            this.unitOfWork       = unitOfWork;
            this.logService       = logService;
            this.tradeService     = new TradeService(unitOfWork, logService);

            this.uniqueJobList = new UniqueJobList(systemParameters, logService, unitOfWork);
            this.sendMessageStatisticService = new SendMessageStatisticService(logService, unitOfWork);
        }
Ejemplo n.º 6
0
        public Every8dSmsProvider(ISystemParameters systemParameters, ILogService logService, IUnitOfWork unitOfWork, SmsProviderType smsProviderType)
        {
            this.userName = systemParameters.Every8dUserName;
            this.password = systemParameters.Every8dPassword;

            this.systemParameters = systemParameters;
            this.logService       = logService;
            this.unitOfWork       = unitOfWork;
            this.smsProviderType  = smsProviderType;

            this.sendMessageStatisticService = new SendMessageStatisticService(logService, unitOfWork);

            this.tradeService = new TradeService(unitOfWork, logService);
        }
Ejemplo n.º 7
0
        public void SaveSystemParameters(ISystemParameters systemParameters)
        {
            try
            {
            System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //configFile,
                ConfigurationSection section =
                    config.RootSectionGroup.SectionGroups["applicationSettings"].Sections[
                        "TechnicalServices.Configuration.Global.Properties.SystemParametersSettings"];

                //SettingElement systemNameElement = ((ClientSettingsSection) section).Settings.Get("SystemName");
                //if (systemNameElement != null)
                //    systemNameElement.Value.ValueXml.InnerText = systemParameters.SystemName;

                SettingElement reloadImageElement = ((ClientSettingsSection) section).Settings.Get("ReloadImage");
                if (reloadImageElement != null)
                    reloadImageElement.Value.ValueXml.InnerText = systemParameters.ReloadImage;

                SettingElement backgroundPresentationElement =
                    ((ClientSettingsSection) section).Settings.Get("BackgroundPresentationUniqueName");
                if (backgroundPresentationElement != null)
                    backgroundPresentationElement.Value.ValueXml.InnerText =
                        systemParameters.BackgroundPresentationUniqueName;

                SettingElement defaultWndsizeElement = ((ClientSettingsSection) section).Settings.Get("DefaultWndsize");
                if (defaultWndsizeElement != null)
                    defaultWndsizeElement.Value.ValueXml.InnerText = systemParameters.DefaultWndsize;

                SettingElement defaultBkgPresRestoreTimeout = ((ClientSettingsSection)section).Settings.Get("BackgroundScenarioRestoreTimeOut");
                if (defaultBkgPresRestoreTimeout != null)
                    defaultBkgPresRestoreTimeout.Value.ValueXml.InnerText = systemParameters.BackgroundPresentationRestoreTimeout.ToString();

                section.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);
                section.SectionInformation.ForceSave = false;

                ConfigurationManager.RefreshSection("TechnicalServices.Configuration.Global.Properties.SystemParametersSettings");
            }
            catch (Exception ex)
            {
                throw new SystemParametersSaveException(ex.Message);
            }
            
        }
Ejemplo n.º 8
0
        public InfobipSmsProvider(ISystemParameters systemParameters, ILogService logService, IUnitOfWork unitOfWork, SmsProviderType smsProviderType)
        {
            if (smsProviderType == SmsProviderType.InfobipHighQuality)
            {
                this.userName = systemParameters.InfobipHighQualityUserName;
                this.password = systemParameters.InfobipHighQualityPassword;
            }
            else
            {
                this.userName = systemParameters.InfobipNormalQualityUserName;
                this.password = systemParameters.InfobipNormalQualityPassword;
            }

            this.configuration = new Configuration(userName, password);
            this.smsClient     = new SMSClient(configuration);

            this.systemParameters            = systemParameters;
            this.logService                  = logService;
            this.unitOfWork                  = unitOfWork;
            this.smsProviderType             = smsProviderType;
            this.sendMessageStatisticService = new SendMessageStatisticService(logService, unitOfWork);

            this.tradeService = new TradeService(unitOfWork, logService);
        }
Ejemplo n.º 9
0
 public SendMessageRuleController(DbContext context, ILogService logService, ISystemParameters systemParameters)
     : base(context, logService)
 {
     this.sendMessageRuleService = new SendMessageRuleService(new UnitOfWork(context), logService);
     this.systemParameters       = systemParameters;
 }
Ejemplo n.º 10
0
 public DepartmentManagerController(ISystemParameters systemParameters, DbContext context, ILogService logService)
     : base(context, logService)
 {
     this.apiControllerHelper = new ApiControllerHelper(context, logService);
     this.tradeService        = new TradeService(new UnitOfWork(context), logService);
 }
Ejemplo n.º 11
0
 public void SaveSystemParameters(ISystemParameters systemParameters)
 {
     _systemParametersAdapter.SaveSystemParameters(systemParameters);
 }
Ejemplo n.º 12
0
        public void SaveSystemParameters(ISystemParameters systemParameters)
        {
            using (_svc = new SimpleClient<IAdministrationService>())
            {
                try
                {
                    _svc.Open();
                }
                catch (Exception /*ex*/)
                {
                    NoConnectionException error = new NoConnectionException();
                    throw error;
                }

                try
                {
                    _svc.Channel.SaveSystemParameters(systemParameters);
                }
                catch (FaultException Ex)
                {
                   throw new SystemParametersSaveException(Ex.Message);
                }

            }
        }
Ejemplo n.º 13
0
 public GMailProvider(ISystemParameters systemParameters, ILogService logService)
 {
     this.userName   = systemParameters.EMailUserName;
     this.password   = systemParameters.EMailPassword;
     this.logService = logService;
 }
Ejemplo n.º 14
0
 public void SaveSystemParameters(ISystemParameters systemParameters)
 {
     try
     {
         _serviceConfiguration.SaveSystemParameters(systemParameters);
     }
     catch (SystemParametersSaveException ex)
     {
         SystemParametersSaveException deleteError = new SystemParametersSaveException(ex.Message);
         throw new FaultException<SystemParametersSaveException>(deleteError, new FaultReason(ex.Message));
     }
 }
Ejemplo n.º 15
0
 public GroupController(ISystemParameters systemParameters, DbContext context, ILogService logService)
     : base(context, logService)
 {
     this.systemParameters = systemParameters;
 }
Ejemplo n.º 16
0
 public FileManagerApiController(IUnitOfWork unitOfWork, ILogService logService, ISystemParameters systemParameters)
     : base(unitOfWork, logService)
 {
     this.systemParameters = systemParameters;
 }
Ejemplo n.º 17
0
 public void SaveSystemParameters(ISystemParameters systemParameters)
 {
     throw new NotImplementedException();
 }