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; }
public Profile(ProfileModel parameters) { Parameters = parameters; Queries = DataExportClientDataManager.GetQueriesForProfile(Parameters.ProfileId); }
public Profile() { Parameters = new ProfileModel(); Queries = new List<QueryModel>(); }
public static void EditCurrentProfile(ProfileModel newProfileModel) { DataExportClientDataManager.EditProfile(CurrentProfile.Parameters.ProfileId, newProfileModel); LoadProfiles(); SetCurrentProfile(newProfileModel.ProfileName); }
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; }
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(); }
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); }