Beispiel #1
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var vendasSelect = ((System.Data.DataRowView)
                                this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                               as DataGridViewExample.QuerysInnerJoinDataSet1.VendasRow;

            switch (e.ColumnIndex)
            {
            case 0:     //Coluna deletar
            {
                this.vendasTableAdapter.DeleteQuery(vendasSelect.Id);
            }
            break;

            case 1:
            {
                frmEdicaoVendas editVenda = new frmEdicaoVendas();
                editVenda.VendasRow = vendasSelect;
                editVenda.ShowDialog();

                this.vendasTableAdapter.Update(editVenda.VendasRow);
            }
            break;
            }
            this.vendasTableAdapter.CustomQuery(querysInnerJoinDataSet1.Vendas);
        }
Beispiel #2
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var vendasSelect = ((System.Data.DataRowView)
                                this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                               as DataGridView.ExerciciosFinaisDataSet1.VendasRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                this.vendasTableAdapter.DeleteQuery(vendasSelect.Id);
                this.vendasTableAdapter.CustomQuery(exerciciosFinaisDataSet1.Vendas);
            }
            break;

            case 1:
            {
                frmEdicaoVendas editVendas = new frmEdicaoVendas()
                {
                    vendasRow = vendasSelect
                };
                editVendas.ShowDialog();

                this.vendasTableAdapter.Update(editVendas.vendasRow);
            }
            break;
            }
            this.vendasTableAdapter.CustomQuery(this.exerciciosFinaisDataSet1.Vendas);
        }
Beispiel #3
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var vendasSelect = ((System.Data.DataRowView)
                                this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                               as DataGridView.QuerysInnerJoinDataSet1.VendasRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                this.vendasTableAdapter.DeleteQuery(vendasSelect.Id);
            }
            break;

            case 1:
            {
                frmEdicaoVendas editVendas = new frmEdicaoVendas();
                editVendas.VendasRow = vendasSelect;
                editVendas.ShowDialog();

                //COM ESSE EXEMPLO NAO PRECISA CRIAR QUERY

                this.vendasTableAdapter.Update(editVendas.VendasRow);
            }
            break;
            }

            this.vendasTableAdapter.CustomQuery(this.querysInnerJoinDataSet1.Vendas);
        }
Beispiel #4
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var vendasSelect = ((System.Data.DataRowView)
                                this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row

                               as DataGridViewExample.QuerysInnerJoinDataSet1.VendasRow;


            switch (e.ColumnIndex)
            {
            case 0:
            {
                // Esse código ta convertendo toda a linha para uma

                this.vendasTableAdapter.DeleteQuery(vendasSelect.Id);
            } break;


            case 1:
            {
                frmEdicaoVendas edicaoVendas = new frmEdicaoVendas();
                edicaoVendas.VendasRow = vendasSelect;
                edicaoVendas.ShowDialog();

                /*  this.carrosTableAdapter.UpdateQuery1(
                 *    edicaoCarros.CarrosRow.Modelo,
                 *    edicaoCarros.CarrosRow.Ano.ToString(),
                 *    edicaoCarros.CarrosRow.Marca,
                 *    edicaoCarros.CarrosRow.UsuAlt,
                 *    DateTime.Now,
                 *    edicaoCarros.CarrosRow.Id);*/
                this.vendasTableAdapter.Update(edicaoVendas.VendasRow);
            }
            break;
            }

            this.vendasTableAdapter.CustomQuery(querysInnerJoinDataSet1.Vendas);
        }
Beispiel #5
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var carSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                            as QuerysInnerJoinDataSet.VendasRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
                frmEdicaoVendas editVenda = new frmEdicaoVendas();
                editVenda.VendasRow = carSelect;
                editVenda.ShowDialog();

                this.vendasTableAdapter.Update(editVenda.VendasRow);
            }
            break;

            case 1:
            {
            }
            break;
            }
        }