Beispiel #1
0
        private void BtSchedule_Click(object sender, RoutedEventArgs e)
        {
            BtSchedule.IsEnabled = false;
            //TpPicker.Expanded = false;
            if (_isReschedule)
            {
                SqlCe.UpdateAppSchedule(_scheduleId, TpPicker.SelectedDate);
                Globals.Log.Information($"Updated schedule: {TpPicker.SelectedDate} Available application: '{_app.Name}'");
            }
            else
            {
                _isReschedule = true;
                SqlCe.CreateAppSchedule(TpPicker.SelectedDate, _app.Id, _app.Revision, false, _app.InstallState.Equals("Installed") ? "U" : "I");
                Globals.Log.Information($"Created schedule: {TpPicker.SelectedDate} Available application: '{_app.Name}'");
            }

            SetStatus(_app);
        }
        private void BtSchedule_Click(object sender, RoutedEventArgs e)
        {
            BtInstall.IsEnabled  = false;
            BtSchedule.IsEnabled = false;

            if (_isReschedule)
            {
                SqlCe.UpdateAppSchedule(_scheduleId, TpPicker.SelectedDate);
                Globals.Log.Information($"Updated sup schedule with id '{_scheduleId}' to execute at '{TpPicker.SelectedDate}'");
            }
            else
            {
                _isReschedule = true;
                _scheduleId   = SqlCe.CreateSupSchedule(TpPicker.SelectedDate);
                Globals.Log.Information($"Created new sup schedule with id '{_scheduleId}' to execute at '{TpPicker.SelectedDate}'");
            }

            SetStatus(ScheduleStatus.Green);
        }
        private void BtSchedule_Click(object sender, RoutedEventArgs e)
        {
            //TpPicker.Expanded = false;
            BtInstall.IsEnabled  = false;
            BtSchedule.IsEnabled = false;
            BtRepair.IsEnabled   = false;

            if (_isReschedule)
            {
                SqlCe.UpdateAppSchedule(_scheduleId, TpPicker.SelectedDate);
                Globals.Log.Information($"Updated schedule: {TpPicker.SelectedDate} Required application: '{_app.Name}'");

                /*
                 * SqlCe.UpdateAppSchedule(_scheduleId, TpPicker.PickedTime);
                 * Globals.Log.Information($"Updated schedule: {TpPicker.PickedTime.ToString()} Required application: '{_app.Name}'");
                 */
            }
            else if (!_app.InstallState.Equals("Installed"))
            {
                _isReschedule = true;
                SqlCe.CreateAppSchedule(TpPicker.SelectedDate, _app.Id, _app.Revision);
                Globals.Log.Information($"Created schedule: {TpPicker.SelectedDate} Required application: '{_app.Name}'");

                /*
                 * SqlCe.CreateAppSchedule(TpPicker.PickedTime, _app.Id, _app.Revision);
                 * Globals.Log.Information($"Created schedule: {TpPicker.PickedTime.ToString()} Required application: '{_app.Name}'");
                 */
            }
            else if (_app.InstallState.Equals("Installed"))
            {
                _isReschedule = true;
                SqlCe.CreateAppSchedule(TpPicker.SelectedDate, _app.Id, _app.Revision, false, "R");
                Globals.Log.Information($"Created schedule: {TpPicker.SelectedDate} Repair required application: '{_app.Name}'");
            }

            SetStatus(_app);
            BtInstall.IsEnabled  = !_app.InstallState.Equals("Installed");
            BtSchedule.IsEnabled = true;
            BtRepair.IsEnabled   = _app.InstallState.Equals("Installed") && _app.AllowedActions.Contains("Repair");
        }