Exemplo n.º 1
0
        private async void dgvOsoblje_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int columnindex = dgvOsoblje.CurrentCell.ColumnIndex;

            if (columnindex == 4)
            {
                var id = dgvOsoblje.CurrentRow.Cells[0].Value;

                var zanimanje = dgvOsoblje.CurrentRow.Cells[3]
                                .Value.ToString();

                if (zanimanje == "Doktor")
                {
                    frmDetaljiDoktor doktor = new frmDetaljiDoktor(int.Parse(id.ToString()));
                    doktor.Show();
                }
                if (zanimanje == "Tehnicar")
                {
                    frmDetaljiTehnicar tehnicar = new frmDetaljiTehnicar(int.Parse(id.ToString()));
                    tehnicar.Show();
                }
            }
            else if (columnindex == 5)
            {
                var id = dgvOsoblje.CurrentRow.Cells[0].Value;
                try
                {
                    await _osoblje.Delete <object>(id);

                    MessageBox.Show("Operacija uspješna");
                }
                catch (Exception)
                {
                    MessageBox.Show("Operacija nije uspješna");
                }
            }
        }
Exemplo n.º 2
0
        private void picDodajTehnicara_Click(object sender, EventArgs e)
        {
            frmDetaljiTehnicar doktor = new frmDetaljiTehnicar();

            doktor.Show();
        }