private void cmdEDIT_Click(object sender, EventArgs e) { if (dataGridView1.SelectedCells.Count > 0) { Guid _rowID = (Guid)dataGridView1.SelectedCells[0].OwningRow.Cells["RowID"].Value; Master.frmMotorUpdate ifrmChild = new Master.frmMotorUpdate(this, _rowID); ifrmChild.ShowDialog(); } else { MessageBox.Show(Messages.Error.RowNotSelected); } }
private void cmdADD_Click(object sender, EventArgs e) { if (dgvMerk.SelectedCells.Count > 0) { _merkRowID = (Guid)dgvMerk.SelectedCells[0].OwningRow.Cells["RowIDMerk"].Value; } else { _merkRowID = Guid.Empty; } _produkRowID = (Guid)dgvProduk.SelectedCells[0].OwningRow.Cells["RowIDProduk"].Value; _merkMotor = dgvMerk.SelectedCells[0].OwningRow.Cells["Merk"].Value.ToString(); if (_merkRowID == Guid.Empty) { MessageBox.Show("Silahkan pilih Merk Motor terlebih dahulu !"); } else { Master.frmMotorUpdate ifrmChild = new Master.frmMotorUpdate(this, _merkRowID, _merkMotor, _produkRowID); ifrmChild.ShowDialog(); } }