private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex != dataGridView1.Columns["Seleccionar"].Index) { return; } this.SelectedUsrname = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); switch (f) { case "Baja": ConfirmarEliminarUsuarioDialog dBaja = new ConfirmarEliminarUsuarioDialog(this.SelectedUsrname); dBaja.ShowDialog(); this.fillGrid(); break; case "Modificacion": if (tipo.Equals("Cliente")) { ModificacionCliente dModif = new ModificacionCliente(this.SelectedUsrname); dModif.ShowDialog(); this.fillGrid(); } else { ModificacionProveedor dModifP = new ModificacionProveedor(this.SelectedUsrname); dModifP.ShowDialog(); this.fillGrid(); } break; case "GiftCard": this.giftcardWindow.TxtBoxUsuarioDestino.Text = this.SelectedUsrname; this.Close(); break; } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex != dataGridView1.Columns["Seleccionar"].Index) return; this.SelectedUsrname = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); switch (f) { case "Baja": ConfirmarEliminarUsuarioDialog dBaja = new ConfirmarEliminarUsuarioDialog(this.SelectedUsrname); dBaja.ShowDialog(); this.fillGrid(); break; case "Modificacion": if (tipo.Equals("Cliente")) { ModificacionCliente dModif = new ModificacionCliente(this.SelectedUsrname); dModif.ShowDialog(); this.fillGrid(); } else { ModificacionProveedor dModifP = new ModificacionProveedor(this.SelectedUsrname); dModifP.ShowDialog(); this.fillGrid(); } break; case "GiftCard": this.giftcardWindow.TxtBoxUsuarioDestino.Text = this.SelectedUsrname; this.Close(); break; } }