Exemple #1
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var marcasSelect = ((System.Data.DataRowView)
                                this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                               as DataGridView.QuerysInnerJoinDataSet1.MarcasRow;

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

            case 1:
            {
                frmEdicaoMarcas editMarcas = new frmEdicaoMarcas();
                editMarcas.MarcasRow = marcasSelect;
                editMarcas.ShowDialog();

                //COM ESSE EXEMPLO NAO PRECISA CRIAR QUERY
                this.marcasTableAdapter.Update(editMarcas.MarcasRow);
            }
            break;
            }



            this.marcasTableAdapter.CustomQuery(querysInnerJoinDataSet1.Marcas);
        }
Exemple #2
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var marSelect = ((System.Data.DataRowView)
                             this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                            as DataGridViewExempleForm.QuerysInnerJoinDataSet1.MarcasRow;

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

            case 1:
            {
                frmEdicaoMarcas editMarca = new frmEdicaoMarcas();
                editMarca.ModeloRow = marSelect;
                editMarca.ShowDialog();

                this.marcasTableAdapter.Update(editMarca.ModeloRow);
            }
            break;
            }



            //this.marcasTableAdapter.DeleteQuery(marSelect.Id);
            this.marcasTableAdapter.CustomQuery(querysInnerJoinDataSet1.Marcas);
        }
Exemple #3
0
        private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var carSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row
                            as QuerysInnerJoinDataSet.MarcasRow;

            switch (e.ColumnIndex)
            {
            case 0:
            {
            }
            break;

            case 1:
            {
                frmEdicaoMarcas editMarca = new frmEdicaoMarcas();
                editMarca.MarcasRow = carSelect;
                editMarca.ShowDialog();

                this.marcasTableAdapter.UpdateQuery(
                    editMarca.MarcasRow.Nome,
                    editMarca.MarcasRow.UsuAlt,
                    DateTime.Now,
                    editMarca.MarcasRow.Id);
            }
            break;
            }
        }