private void dbDataGridView_permessi_MouseDoubleClick(object sender, MouseEventArgs e) { try { if (dbDataGridView_cat_ute.SelectedRows.Count > 0) { DataRowView drv = dbDataGridView_cat_ute.SelectedRows[0].DataBoundItem as DataRowView; if (drv != null) { DataSet.dsMaintenance.Man_Ana_Tipo_UtenteRow row = drv.Row as DataSet.dsMaintenance.Man_Ana_Tipo_UtenteRow; if (dbDataGridView_permessi.SelectedRows.Count > 0) { DataRowView drv_per = dbDataGridView_permessi.SelectedRows[0].DataBoundItem as DataRowView; if (drv_per != null) { DataSet.dsMaintenance.Man_Ana_PermessiRow row_per = drv_per.Row as DataSet.dsMaintenance.Man_Ana_PermessiRow; tipoUtente_PermessiTableAdapter.InsertQuery(row.TipoUteKey, row_per.PermessiKey); RefreshTipoUtentiPermessi(); } } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void RefreshTipoUtentiPermessi() { if (dbDataGridView_cat_ute.SelectedRows.Count > 0) { DataRowView drv = dbDataGridView_cat_ute.SelectedRows[0].DataBoundItem as DataRowView; if (drv != null) { DataSet.dsMaintenance.Man_Ana_Tipo_UtenteRow row = drv.Row as DataSet.dsMaintenance.Man_Ana_Tipo_UtenteRow; tipoUtente_PermessiTableAdapter.Fill(dsMaintenance.TipoUtente_Permessi, row.TipoUteKey); } } }