コード例 #1
0
        private async void DgvTroskovi_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var id = dgvTroskovi.SelectedRows[0].Cells[0].Value;

            if (e.ColumnIndex == 7)
            {
                int idTroska = int.Parse(id.ToString());
                var troskovi = await _aPIService.GetById <Model.Troskovi>(id);

                var listaTroskova = await _aPIService.Get <List <Model.Troskovi> >();

                foreach (var t in listaTroskova)
                {
                    if (t.TrosakId == idTroska)
                    {
                        troskovi.BrojPredmeta = t.BrojPredmeta;
                    }
                }

                Izvjestaji.Form1 frmR = new Izvjestaji.Form1();
                frmR.troskovi = troskovi;
                frmR.Show();
                return;
            }


            frmTroskoviDetalji frm = new frmTroskoviDetalji(int.Parse(id.ToString()), this);

            frm.Show();
        }
コード例 #2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var id = dgvTroskovi.SelectedRows[0].Cells[0].Value;
            frmTroskoviDetalji frm = new frmTroskoviDetalji(int.Parse(id.ToString()), this);

            if (int.Parse(id.ToString()) != 0)
            {
                frm.Show();
            }
        }