예제 #1
0
파일: frmProdana.cs 프로젝트: Olafyngvi/RS2
        private void DgvProdana_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvProdana.Columns[e.ColumnIndex].Name == "Detalji")
            {
                var id = dgvProdana.Rows[e.RowIndex].Cells[0].Value;

                frmDetaljiVozila forma = new frmDetaljiVozila(int.Parse(id.ToString()), null, this);
                forma.Show();
            }
        }
예제 #2
0
파일: frmVozila.cs 프로젝트: Olafyngvi/RS2
        private async void DgvVozila_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvVozila.Columns[e.ColumnIndex].Name == "Detalji")
            {
                var id = dgvVozila.Rows[e.RowIndex].Cells[0].Value;

                frmDetaljiVozila forma = new frmDetaljiVozila(int.Parse(id.ToString()), this);
                forma.Show();
            }

            else if (dgvVozila.Columns[e.ColumnIndex].Name == "Arhiviraj")
            {
                var id = dgvVozila.Rows[e.RowIndex].Cells[0].Value;

                if (MessageBox.Show("Da li ste sigurni da želite arhivirati podatke o ovom vozilu?", "Poruka", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    await _vozila.Delete(id);
                    await GetVozila();

                    MessageBox.Show("Zapis uspješno arhiviran");
                }
            }
        }