Пример #1
0
        private void btnInserirItem_Click(object sender, EventArgs e)
        {
            InserirItem telainserir = new InserirItem(user);

            Log.LogDAO logdao = new Log.LogDAO();
            if (telainserir.ShowDialog() == DialogResult.OK)
            {
                Atualizar_DataGrid();
            }
        }
Пример #2
0
        private void btnexibir_Click(object sender, EventArgs e)
        {
            Item item = new Item();

            try
            {
                item.id         = Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value);
                item.nome       = Convert.ToString(dataGridView1[1, dataGridView1.CurrentRow.Index].Value);
                item.observacao = Convert.ToString(dataGridView1[2, dataGridView1.CurrentRow.Index].Value);
                item.descricao  = Convert.ToString(dataGridView1[3, dataGridView1.CurrentRow.Index].Value);
            }
            catch
            {
            }
            finally
            {
                InserirItem alteraritem = new InserirItem(item);
                alteraritem.Show();
            }
        }
Пример #3
0
        private void btnAlterarItem_Click(object sender, EventArgs e)
        {
            Item item = new Item();

            try
            {
                item.id         = Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value);
                item.nome       = Convert.ToString(dataGridView1[1, dataGridView1.CurrentRow.Index].Value);
                item.observacao = Convert.ToString(dataGridView1[2, dataGridView1.CurrentRow.Index].Value);
                item.descricao  = Convert.ToString(dataGridView1[3, dataGridView1.CurrentRow.Index].Value);
            }
            catch
            {
            }
            finally
            {
                InserirItem alteraritem = new InserirItem(item, user);
                if (alteraritem.ShowDialog() == DialogResult.OK)
                {
                    Atualizar_DataGrid();
                }
            }
        }