using DatenDB; using Deckungsbeitrag.Properties; using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TrelloIntegration; namespace Deckungsbeitrag { public partial class FormEinstellung : Form { private readonly UserSettingsManager _settings = new UserSettingsManager(); string varkosten = ConfigurationManager.AppSettings["Variabel"]; string fixlohnkosten = ConfigurationManager.AppSettings["FixLohn"]; string fixmietkosten = ConfigurationManager.AppSettings["FixMiete"]; public bool changed = false; public bool validating = true; private Benutzer benutzer; public FormEinstellung() { InitializeComponent(); } public FormEinstellung(object x) : this() { if (x.GetType() == typeof(String)) { if (x.ToString() == "Sortiment") { ButtonPfad_Click(buttonSortiment, null); this.textBoxSortiment.BackColor = Color.Red; } } else { if (x.GetType() == typeof(Benutzer)) { this.benutzer = (Benutzer)x; if (benutzer.Rolle == BenutzerRolle.Expedit) { foreach (TabPage tP in this.tabControlEinstellung.TabPages) { if (!tP.Name.Contains("Drucker")) this.tabControlEinstellung.Controls.Remove(tP); } } } } } private void FormEinstellung_Load(object sender, EventArgs e) { // Standard Drucker und Kopieanzahl einstellen. foreach (string printer in PrinterSettings.InstalledPrinters) { this.comboBoxEtikettDrucker.Items.Add(printer); this.comboBoxSWSDrucker.Items.Add(printer); this.comboBoxTourenlisteDrucker.Items.Add(printer); } Load_Settings(); } private void Load_Settings() { _settings.Load(); //TODO: Settings hier ändern auf UserSettingsManager Klasse. this.checkBoxMaxWert.Checked = Settings.Default.MaxChecked; this.checkBoxMinWert.Checked = Settings.Default.MinChecked; this.numUpDownAnzahl.Value = Settings.Default.ZAnzahl; if (checkBoxMaxWert.Checked) { this.numUpDownMaxWert.Value = (int)Settings.Default.RatMax; this.numUpDownMaxWert.Enabled = true; } if (checkBoxMinWert.Checked) { this.numUpDownMinWert.Value = (int)Settings.Default.RatMin; this.numUpDownMinWert.Enabled = true; } this.textBoxSortiment.Text = ConfigurationManager.AppSettings["SortimentPfad"]; this.textBoxRatingbild.Text = ConfigurationManager.AppSettings["BildPfad"]; // Ab hier wurde bereits auf UserSettingsManager umgebaut. this.comboBoxEtikettDrucker.SelectedText = _settings.DruckerEtikett; this.comboBoxTourenlisteDrucker.SelectedText = _settings.DruckerTourenListe; this.comboBoxSWSDrucker.SelectedText = _settings.DruckerSWS; this.numericUpDownSWSKopien.Value = _settings.CopiesSWS; foreach (Button btn in this.groupBoxFarben.Controls.OfType