Beispiel #1
0
 public SchedulerControl(IScheduleSettings settings, IActionSettings actionSettings)
 {
     InitializeComponent();
     _setting        = settings;
     _actionSettings = actionSettings;
     SetData();
 }
Beispiel #2
0
        private void Setup()
        {
            autoCompleteTextView = FindViewById <AutoCompleteTextView>(Resource.Id.autocompletetextview_auth);
            autoCompleteTextView.SetOnEditorActionListener(this);

            textChangeListener = new TextChangeListener(this, autoCompleteTextView);
            autoCompleteTextView.AddTextChangedListener(textChangeListener);

            var buttonAuth = FindViewById <Button>(Resource.Id.button_auth);

            buttonAuth.Click += ButtonAuth_Click;

            var skipAuthTextView = FindViewById <TextView>(Resource.Id.textview_auth_skip);

            skipAuthTextView.Click += SkipAuthTextView_Click;

            scheduleSettings = AndroidDependencyContainer.Instance.ScheduleSettings;

            isTeacher = Intent.Extras.GetBoolean(UserTypeSelectActivity.IsTeacherIntentExtraName);

            var titleTextView = FindViewById <TextView>(Resource.Id.textview_auth_edittext_title);

            if (isTeacher)
            {
                skipAuthTextView.Text     = Resources.GetString(Resource.String.auth_teacher_later);
                titleTextView.Text        = Resources.GetString(Resource.String.auth_teacher_title);
                autoCompleteTextView.Hint = Resources.GetString(Resource.String.auth_teacher_hint);
            }
            else
            {
                skipAuthTextView.Text     = Resources.GetString(Resource.String.group_later);
                titleTextView.Text        = Resources.GetString(Resource.String.edittext_title);
                autoCompleteTextView.Hint = Resources.GetString(Resource.String.edittext_auth);
            }
        }
        public static Task <ScheduleRepository> CreateAsync(IScheduleSettings scheduleSettings,
                                                            SQLiteDatabase database)
        {
            var repository = new ScheduleRepository(scheduleSettings);

            return(repository.InitializeAsync(database));
        }
Beispiel #4
0
 public ScheduleDownloader(INetworkChecker networkChecker, IScheduleSettings scheduleSettings,
                           IHttpClientService httpClientService)
 {
     this.networkChecker    = networkChecker;
     this.scheduleSettings  = scheduleSettings;
     this.httpClientService = httpClientService;
 }
Beispiel #5
0
 public async Task UpdateAsync(IScheduleSettings scheduleSettings)
 {
     using (var conn = new SqlConnection(_connectionString))
     {
         await conn.ExecuteAsync(
             $"update {TableName} set {GetUpdateClause} where Id=@Id",
             _convertService.Convert <IScheduleSettings, ScheduleSettingsEntity>(scheduleSettings));
     }
 }
Beispiel #6
0
        public MainForm()
        {
            String appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            ConfigSQLiteDB configDb = new ConfigSQLiteDB(appPath);

            _settings         = configDb.Settings;
            _actionSettings   = configDb.ActionSettings;
            _scheduleSettings = configDb.ScheduleSettings;
            InitializeComponent();
        }
Beispiel #7
0
 public TriggerControl(IActionSettings settings, IScheduleSettings scheduleSettings)
 {
     _scheduleSettings = scheduleSettings;
     _settings         = settings;
     InitializeComponent();
     LevelReliability.Text     = @"Обычный";
     VersionExcelСomboBox.Text = @"Книга Excel (*.xlsx)";
     FileName.Text             = @"Ретро_{YYYY}{MM}";
     UI_RunTimeOffset.Value    = DateTime.Now.Date;
     SetData();
 }
Beispiel #8
0
        public ConfigSQLiteDB(string app_path)
        {
            _settings         = new SettingStorage(app_path + "\\" + _config_db_file, _lockConfDB);
            _actionSettings   = new ActionsStorage(app_path + "\\" + _config_db_file, _lockConfDB);
            _scheduleSettings = new ScheduleStorage(app_path + "\\" + _config_db_file, _lockConfDB);

            _local_rsdu_db = new RsduDBSettings(_settings,
                                                ConfigParamDefine.LOCAL_RSDU_DB_DSN,
                                                ConfigParamDefine.LOCAL_RSDU_DB_LOGIN,
                                                ConfigParamDefine.LOCAL_RSDU_DB_PASSWORD,
                                                ConfigParamDefine.LOCAL_RSDU_DB_APP);
        }
Beispiel #9
0
        public async Task <bool> TryInsertAsync(IScheduleSettings scheduleSettings)
        {
            using (var conn = new SqlConnection(_connectionString))
            {
                try
                {
                    await conn.ExecuteAsync(
                        $"insert into {TableName} ({GetColumns}) values ({GetFields})",
                        _convertService.Convert <IScheduleSettings, ScheduleSettingsEntity>(scheduleSettings));
                }
                catch (Exception ex)
                {
                    _log?.WriteWarningAsync(nameof(AssetPairsRepository), nameof(TryInsertAsync),
                                            $"Failed to insert an schedule setting with Id {scheduleSettings.Id}", ex);
                    return(false);
                }

                return(true);
            }
        }
Beispiel #10
0
 public static void Create(IScheduleSettings settings, ILogger logger)
 {
     try {
         TaskService    ts = TaskService.Instance;
         TaskDefinition td = ts.NewTask( );
         td.Settings.Enabled = true;
         {
             Task task = ts.GetTask(settings.TaskName);
             if (task != null)
             {
                 var identity  = WindowsIdentity.GetCurrent( );
                 var principal = new WindowsPrincipal(identity);
                 // Check to make sure account privileges allow task deletion
                 if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
                 {
                     throw new Exception($"Cannot delete task with your current identity '{identity.Name}' permissions level." +
                                         "You likely need to run this application 'as administrator' even if you are using an administrator account.");
                 }
                 // Remove the task we just created
                 ts.RootFolder.DeleteTask(settings.TaskName /*@"\SSL\sitename"*/);
             }
         }
         td.RegistrationInfo.Description = settings.Description;
         // Create a trigger that will fire the task at this time every other day
         td.Triggers.Add(new TimeTrigger( )
         {
             StartBoundary = settings.TriggerDateTime
         });
         // Create an action that will launch Notepad whenever the trigger fires
         td.Actions.Add(new ExecAction(settings.ActionPath, settings.Arguments, settings.StartIn));
         // Register the task in the root folder
         //ts.RootFolder.RegisterTaskDefinition( settings.TaskName, td );
         ts.RootFolder.RegisterTaskDefinition(settings.TaskName, td, TaskCreation.CreateOrUpdate, settings.UserName, settings.Password, TaskLogonType.Password);
     } catch (Exception e) {
         logger.Write("TaskSchedule.Create Error {0}", e.Message);
         logger.Write(e.StackTrace);
     }
 }
Beispiel #11
0
 public Schedule(IScheduleSettings conf)
 {
     this.conf = conf;
 }
Beispiel #12
0
 public ScheduleRunner(IScheduleSettings conf) : base(conf)
 {
 }
 public ScheduleRepository(IScheduleSettings scheduleSettings)
 {
     this.scheduleSettings = scheduleSettings;
 }
Beispiel #14
0
 public ScheduleInstaller(IScheduleSettings conf) : base(conf)
 {
 }