Example #1
0
        public static bool CreateNewProfile(string name)
        {
            if (!Profiles.Exists(a => a.Parameters.ProfileName == name))
            {
                var newProfileModel = new ProfileModel
                    {
                        ProfileName = name,
                        EnableLinkExport = false,
                        EnableScheduleJob = false
                    };
                DataExportClientDataManager.AddNewProfile(newProfileModel, UserId);

                return true;
            }
            return false;
        }
Example #2
0
 public Profile(ProfileModel parameters)
 {
     Parameters = parameters;
     Queries = DataExportClientDataManager.GetQueriesForProfile(Parameters.ProfileId);
 }
Example #3
0
 public Profile()
 {
     Parameters = new ProfileModel();
     Queries = new List<QueryModel>();
 }
Example #4
0
 public static void EditCurrentProfile(ProfileModel newProfileModel)
 {
     DataExportClientDataManager.EditProfile(CurrentProfile.Parameters.ProfileId, newProfileModel);
     LoadProfiles();
     SetCurrentProfile(newProfileModel.ProfileName);
 }
Example #5
0
        public static bool RenameCurrentProfile(string name)
        {
            if (!Profiles.Exists(a => a.Parameters.ProfileName == name) && CurrentProfile.Parameters.ProfileName != name)
            {
                var newProfileModel = new ProfileModel
                {
                    ProfileName = name,
                    EnableLinkExport = CurrentProfile.Parameters.EnableLinkExport,
                    EnableScheduleJob = CurrentProfile.Parameters.EnableScheduleJob,
                    SheduleJobs = CurrentProfile.Parameters.SheduleJobs ?? new List<SheduleJobModel>()
                };
                DataExportClientDataManager.EditProfile(CurrentProfile.Parameters.ProfileId, newProfileModel);

                return true;
            }
            return false;
        }
Example #6
0
        private void ScheduleJobControl_SaveClisk(object sender, EventArgs e)
        {
            var profileModel = new ProfileModel
            {
                ProfileName = ProfilesManager.CurrentProfile.Parameters.ProfileName,
                ProfileId = ProfilesManager.CurrentProfile.Parameters.ProfileId,
                EnableLinkExport = ui_EnableLiveExport_checkBox.Checked,
                EnableScheduleJob = ui_AutomaticJob_checkBox.Checked,
                SheduleJobs = _scheduleJobControl.Schedulas
            };
            ProfilesManager.EditCurrentProfile(profileModel);
            RefreshJobList(_scheduleJobControl.Schedulas);

            CloseScheduleJobControl();
        }
Example #7
0
        private void ui_SaveProfile_button_Click(object sender, EventArgs e)
        {
            if (ui_Profiles_comboBox.SelectedIndex < 0)
            {
                ToastNotification.Show(this, @"Please select a profile.", 2000, eToastPosition.TopCenter);
                return;
            }

            var profileModel = new ProfileModel
            {
                ProfileName = ProfilesManager.CurrentProfile.Parameters.ProfileName,
                ProfileId = ProfilesManager.CurrentProfile.Parameters.ProfileId,
                EnableLinkExport = ui_EnableLiveExport_checkBox.Checked,
                EnableScheduleJob = ui_AutomaticJob_checkBox.Checked,
                SheduleJobs = new List<SheduleJobModel>(ProfilesManager.CurrentProfile.GetSheduleTimes())
            };

            ProfilesManager.EditCurrentProfile(profileModel);
            if (!ProfilesManager.CurrentProfile.Parameters.EnableScheduleJob)
                _exportJobs.ClearJobs(ProfilesManager.CurrentProfile.Parameters.ProfileName);
            else
                RefreshJobList(ProfilesManager.CurrentProfile.Parameters.SheduleJobs);
        }