Ejemplo n.º 1
0
        private void dataGridViewStudents_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow currentRow = this.dataGridViewStudents.CurrentRow;

            if (currentRow == null)
            {
                return;
            }
            DtoStudent dtoStudent = currentRow.Tag as DtoStudent;

            if (dtoStudent == null)
            {
                return;
            }
            int idStudent = dtoStudent.IdStudent;


            OpStudentIspitSelect op  = new OpStudentIspitSelect(idStudent, 0);
            OperationResult      obj = OperationManager.Singleton.executeOperation(op);

            if (obj == null || obj.Items == null)
            {
                return;
            }
            DtoStudentIspit[] studIspiti = obj.Items.Cast <DtoStudentIspit>().ToArray();


            this.dataGridViewStudentIspit.Rows.Clear();
            int rb = 1;

            foreach (DtoStudentIspit item in studIspiti)
            {
                int indeks = this.dataGridViewStudentIspit.Rows.Add(
                    rb.ToString(), item.ImePrezime, item.IspitDatum, item.PredmetNaziv, item.Ocena,
                    item.DvPrijave);
                DataGridViewRow row = this.dataGridViewStudentIspit.Rows[indeks];
                row.Tag = item;
                rb++;
            }
        }
Ejemplo n.º 2
0
        private void comboBoxPredmets_SelectedIndexChanged(object sender, EventArgs e)
        {
            int idPredmet = 0;

            if (this.comboBoxPredmets.SelectedValue != null)
            {
                idPredmet = (int)this.comboBoxPredmets.SelectedValue;
            }

            OpStudentIspitSelect op  = new OpStudentIspitSelect(0, idPredmet);
            OperationResult      obj = OperationManager.Singleton.executeOperation(op);

            if (obj == null || obj.Items == null)
            {
                return;
            }
            DtoStudentIspit[] studIspiti = obj.Items.Cast <DtoStudentIspit>().ToArray();


            this.listViewStudentIspit.BeginUpdate();
            this.listViewStudentIspit.Items.Clear();
            int rb = 1;

            foreach (DtoStudentIspit item in studIspiti)
            {
                ListViewItem listViewItem = new ListViewItem();
                listViewItem.Text = rb.ToString();
                listViewItem.SubItems.Add(item.ImePrezime);
                listViewItem.SubItems.Add(item.IspitDatum.ToString());
                listViewItem.SubItems.Add(item.PredmetNaziv);
                listViewItem.SubItems.Add((item.Ocena == null) ? "" : item.Ocena.ToString());
                listViewItem.SubItems.Add(item.IspitDatum.ToString());
                this.listViewStudentIspit.Items.Add(listViewItem);
                listViewItem.Tag = item;
                rb++;
            }
            this.listViewStudentIspit.EndUpdate();
        }