private void button1_Click(object sender, EventArgs e) { test.Hour = Convert.ToInt32(numericUpDown1.Value); test.Minute = Convert.ToInt32(numericUpDown2.Value); repositoryTest.Add(test); MessageBox.Show("Test is loaded"); }
private void addToolStripMenuItem1_Click(object sender, EventArgs e) { dataGridView1.Visible = true; Form_AddGroup addGroup = new Form_AddGroup(); if (addGroup.ShowDialog() == DialogResult.OK) { Group group = new Group() { Title = addGroup.textBox1.Text, }; repositoryGroup.Add(group); dataGridView1.DataSource = repositoryGroup.GetAll().Select(x => new { Id = x.Id, Tille = x.Title }).ToList(); } }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { dataGridView1.Visible = true; FormUser formUser = new FormUser(); if (formUser.ShowDialog() == DialogResult.OK) { User user = new User() { Name = formUser.textBox1.Text, Login = formUser.textBox2.Text, Password = formUser.textBox3.Text, isAdmin = Convert.ToBoolean(formUser.comboBox1.SelectedItem), }; repositoryUser.Add(user); dataGridView1.DataSource = repositoryUser.GetAll().Select(x => new { Id = x.Id, Name = x.Name, Login = x.Login, Password = x.Password, isAdmin = x.isAdmin }).ToList(); } }