private void buttonDelete_Click(object sender, EventArgs e)
        {
            Datas.Users.RemoveAt(dataGridView1.CurrentRow.Index);
            MainListForm listForm = new MainListForm();

            listForm.Show();
            if (Datas.IsHide)
            {
                this.Hide();
                Datas.IsHide = false;
            }
            else
            {
                this.Close();
            }
        }
Esempio n. 2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            var user = new User
            {
                BirthDay    = dateTimePicker.Value,
                Email       = textBoxEmail.Text,
                FirstName   = textBoxFirstName.Text,
                LastName    = textBoxLastName.Text,
                Login       = textBoxLogin.Text,
                Password    = textBoxPassword.Text,
                PhoneNumber = textBoxPhone.Text
            };

            Datas.Users.Add(user);
            MainListForm listForm = new MainListForm();

            listForm.Show();
            this.Close();
        }