예제 #1
0
        private void btnCancel_Click_1(object sender, EventArgs e)
        {
            this.Close();
            UserTypes ut = new UserTypes(1);

            ut.Show();
        }
예제 #2
0
        private void btnConfirm_Click_1(object sender, EventArgs e)
        {
            TypeUserDB obj = new TypeUserDB();

            obj.AddToDB(tbNameTypeUser.Text);
            UserTypes ut = new UserTypes(1);

            ut.Show();
            this.Close();
        }
예제 #3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            this.Close();
            DialogResult dr = MessageBox.Show("Вы уверены, что хотите удалить объект?", "Вопрос", MessageBoxButtons.YesNo);

            switch (dr)
            {
            case DialogResult.Yes:
                TypeUserDB obj = new TypeUserDB();
                obj.Delete(Convert.ToInt32(((KeyValuePair <string, string>)cbUserTypes.SelectedItem).Key));

                UserTypes ut = new UserTypes(1);
                ut.Show();
                break;

            case DialogResult.No:
                break;
            }
        }