Ejemplo n.º 1
0
        private void NewLanguage_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            AddLanguage window = new AddLanguage();

            window.ShowDialog();

            if (window.DialogResult == true)
            {
                NewLanguageBindingModel newLanguage = window.NewLanguage;

                //Add language
                controller.AddLanguage(newLanguage);

                //Redirect to ViewWords
                OpenDisplay();
            }
        }
Ejemplo n.º 2
0
        //Add Language
        public void AddLanguage(NewLanguageBindingModel model)
        {
            //Creating the Id
            int newID = GenerateId();

            //Generating the new Language
            Language newLanguage = new Language()
            {
                ID         = newID,
                Name       = model.Name,
                HasGenders = model.HasGenders
            };

            //Adding it to the bunch
            languages.Add(newLanguage);
            SaveChanges();

            //Setting it as a chosen one
            SetLanguage(newLanguage.ID);
        }