예제 #1
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            EditarItem form = new EditarItem(new Models.CompraGadoItem()
            {
                Id = 0
            });

            var result = form.ShowDialog();

            _compraGado.CompraGadoItens.Add(form._item);

            popularGrid();
        }
예제 #2
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            if (dgItens.SelectedRows.Count > 0)
            {
                var item = (Models.CompraGadoItem)dgItens.SelectedRows[0].DataBoundItem;

                EditarItem form = new EditarItem(item);

                var result = form.ShowDialog();

                _compraGado.CompraGadoItens.Add(form._item);

                popularGrid();
            }
        }