Exemplo n.º 1
0
        /// <summary>
        /// Creates the <see cref="AddNewType"/> form
        /// and allows the user to create a new type
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void newTypeBtn_Click(object sender, EventArgs e)
        {
            var addnewType = new AddNewType();
            var res        = addnewType.ShowDialog();

            if (res != DialogResult.OK)
            {
                MessageBox.Show("Invalid type forsøgt oprettet");
            }

            var type  = new VareType(addnewType.Type);
            var items = _db.GetCollection <VareType>("type");

            items.Insert(type);
            UpdateTypeCombobox();
        }
Exemplo n.º 2
0
        private void NewType_Click(object sender, RoutedEventArgs e)
        {
            var s = new AddNewType();

            s.ShowDialog();
        }