public Einstellungen Update(Einstellungen currentEinstellungen)
 {
     _context.Attach(currentEinstellungen);
     _context.Entry(currentEinstellungen).State = EntityState.Modified;
     _context.SaveChanges();
     return(currentEinstellungen);
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Calculation"/> class.
        /// </summary>
        public Calculation()
        {
            // Einstellungs-Datei öffnen
            var settings = Einstellungen.Load <Einstellungen>(new XmlFilePath("einstellungen.xml"));

            // Name des zu verwendenden Profils aus den Einstellungen
            var profilName = settings.Profilname;

            Tools.OutputText("Verwendetes Profil: " + profilName, ConsoleColor.DarkGray);
            Tools.OutputText();

            // Es interessiert von den Einstellungen nur das geforderte Profil
            _profil = settings.Profil.Single(p => p.Profilname.Equals(profilName, StringComparison.OrdinalIgnoreCase));

            // Connection Strings
            var dbConfigurations = new DbConfigurations();

            dbConfigurations.Add("DatenDb", _profil.ConnectionStringDatenDb.ProviderName, _profil.ConnectionStringDatenDb.ConnectionString);
            dbConfigurations.Add("ZeitmessDb", _profil.ConnectionStringZeitmessDb.ProviderName, _profil.ConnectionStringZeitmessDb.ConnectionString);

            DataConnection.DefaultSettings = dbConfigurations;

            // Datenbanken einlesen

            // DatenDB
            using (var db = new DatenDB("DatenDb"))
            {
                _races = db.TRennens.OrderBy(x => x.RTag).ThenBy(x => x.RZeit).ToList();
                _boats = db.TBootes.ToList();
                _clubs = db.TVereins.ToList();
                Tools.OutputText("Connection-String für 'DatenDB':", ConsoleColor.DarkYellow);
                Tools.OutputText($"({db.ConnectionString})", ConsoleColor.DarkYellow);
                Tools.OutputText(db.ConnectionString, ConsoleColor.Yellow);
                Tools.OutputText();
            }

            // ZeitmessDB
            using (var db = new ZeitmessDB("ZeitmessDb"))
            {
                _zielZeiten = db.ZielZeitens.ToList();
                Tools.OutputText("Connection-String für 'ZeitmessDB':", ConsoleColor.DarkYellow);
                Tools.OutputText($"({db.ConnectionString})", ConsoleColor.DarkYellow);
                Tools.OutputText(db.ConnectionString, ConsoleColor.Yellow);
                Tools.OutputText();
            }

            // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // !!! manuelle Korrekturen !!!

            /*
             * var race = _races.SingleOrDefault(r => r.RNr == "LE255" && r.RLaufTyp == "EF"));
             * if (race != null)
             * {
             *  race.RAnzRudererBoot = 4;
             * }
             */
            // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        }
示例#3
0
        private async void MenueEinstellungenLabel_Click(object sender, EventArgs e)
        {
            this.SetzeSchlange(this.MenueEinstellungenSchlange);
            await Task.Delay(150);

            using (var einstellungsFenster = new Einstellungen())
            {
                einstellungsFenster.ShowDialog(this);
            }
        }
示例#4
0
        public ActionResult Put(int id, [FromBody] Einstellungen einstellungen)
        {
            if (einstellungen == null)
            {
                return(BadRequest());
            }

            Einstellungen orig = _einstellungenService.GetEinstellungById(id);

            if (orig == null)
            {
                return(NotFound());
            }

            _einstellungenService.UpdateEinstellungen(einstellungen);

            return(new NoContentResult());
        }
示例#5
0
        private void Button_Anmelden_Click(object sender, EventArgs e)
        {
            Einstellungen.LoadFromConfig();
            User _user = new User(textBox_Username.Text, textBox_Kennwort.Text);

            _user.Anmelden();
            textBox_Kennwort.Text = "";
            if (_user.ID > 0)
            {
                MainKartei mainKartei = new MainKartei(_user, this);
                mainKartei.Show();
            }
            else if (_user.ID == -2)
            {
            }
            else
            {
                MessageBox.Show("Es konnte keine Passende Anmeldung gefunden. \nBitte überpüfen Sie ihre Eingaben", "Konnte nicht Anmelden!");
            }
        }
示例#6
0
    public void SaveFile()
    {
        string     destination = Application.persistentDataPath + "/save.dat";
        FileStream file;

        if (File.Exists(destination))
        {
            file = File.OpenWrite(destination);
        }
        else
        {
            file = File.Create(destination);
        }

        Einstellungen   data = new Einstellungen(musikLautstärke, soundLautstärke);
        BinaryFormatter bf   = new BinaryFormatter();

        bf.Serialize(file, data);
        file.Close();
        Debug.Log("SaveFile");
    }
示例#7
0
        // private void ShutdownWarnMe(object sender, System.ComponentModel.CancelEventArgs e) => PrepareShutdown();

        // *********************************************************************************
        // PRIVATE FUNCTIONS
        // *********************************************************************************

        /// <summary>
        /// Setzt alle Werte auf Standard Einstllungen zurück.
        /// Erstellt einen neuen Tag wenn es noch keinen gibt.
        /// </summary>
        private void InitFormValues()
        {
#if TRACE
            INFO("InitFormValues");
#endif

            // init new day of working
            if (!WARNME_CONFIG.WORKINGDAYS.ContainsKey(TODAY))
            {
                DateTime upTime = Extern.SystemUpTime;
                // check if uptime is today else add the actual time
                TimeSpan startZeit = (upTime.Date == TODAY ? upTime.TimeOfDay : NOW);
                startZeit -= WARNME_CONFIG.TIME.START_DELAY;
                WARNME_CONFIG.WORKINGDAYS.Add(TODAY, new Arbeitstag()
                {
                    StartZeit = startZeit,
                    EndZeit   = NOW,
                    Bemerkung = ""
                });
            }

            Home.StartTimePicker.DateTime = WARNME_CONFIG.WORKINGDAYS[TODAY].StartZeit;

            Home.EndTimePicker.DateTime    = WARNME_CONFIG.WORKINGDAYS[TODAY].StartZeit + WARNME_CONFIG.TIME.WORKTIME;
            Home.MaxEndTimePicker.DateTime = WARNME_CONFIG.WORKINGDAYS[TODAY].StartZeit + WARNME_CONFIG.TIME.WORKLIMIT;

            NewDataAvailable();

            // Color
            BorderBrush          = new SolidColorBrush(WARNME_CONFIG.COLORS.ACCENT_COLOR);
            TitleGrid.Background = new SolidColorBrush(WARNME_CONFIG.COLORS.MAIN_COLOR);
            MainGrid.Background  = new SolidColorBrush(WARNME_CONFIG.COLORS.MAIN_COLOR_WEAK);


            // WORKINGDAY TABLE
            Übersicht.Update();

            Einstellungen.Init();
            Einstellungen.Update();
        }
示例#8
0
    public void LoadFile()
    {
        string     destination = Application.persistentDataPath + "/save.dat";
        FileStream file;

        if (File.Exists(destination))
        {
            file = File.OpenRead(destination);
        }
        else
        {
            Debug.LogError("File not found");
            return;
        }

        BinaryFormatter bf   = new BinaryFormatter();
        Einstellungen   data = (Einstellungen)bf.Deserialize(file);

        file.Close();

        MusikLautstärke = data.MusikLautstärke;
        SoundLautstärke = data.SoundLautstärke;
        Debug.Log("Laden der Einstelungen war erfolgreich");
    }
示例#9
0
 public void Put([FromBody] Einstellungen einstellungen)
 {
     _einstellungenService.Update(einstellungen);
 }
 public void UpdateEinstellungen(Einstellungen einstellungen)
 {
     //     _context.Einstellungen.Update(einstellungen);
     //   _context.SaveChangesAsync();
 }
示例#11
0
        private void btnEinstellungen_Click(object sender, EventArgs e)
        {
            Einstellungen ein = new Einstellungen(this);

            ein.Show();
        }