Beispiel #1
0
        private void PregledBtn_Click(object sender, EventArgs e)
        {
            if (zahtjeviTerminiTabControl.SelectedTab == zahtjeviTerminiTabControl.TabPages["tabPage1"])
            {
                if (neProcitanoGridView.SelectedRows.Count != 0)
                {
                    int ZahtjevId = Convert.ToInt32(neProcitanoGridView.SelectedRows[0].Cells[0].Value);
                    StudentZahtjevForm zahtjev = new StudentZahtjevForm(ZahtjevId);
                    zahtjev.FormClosed += new FormClosedEventHandler(Form_Closed);
                    zahtjev.ShowDialog();
                    zahtjev.MdiParent = this.MdiParent;
                }
            }

            if (zahtjeviTerminiTabControl.SelectedTab == zahtjeviTerminiTabControl.TabPages["tabPage2"])
            {
                if (terminiGridView.SelectedRows.Count != 0)
                {
                    int StudentId = Convert.ToInt32(terminiGridView.SelectedRows[0].Cells[0].Value);
                    StudentKontakInfoForm kontakInfo = new StudentKontakInfoForm(StudentId);
                    kontakInfo.ShowDialog();
                    kontakInfo.MdiParent = this.MdiParent;
                }
            }
        }
Beispiel #2
0
        private void ZakaziBtn_Click(object sender, EventArgs e)
        {
            TerminCasa termin = new TerminCasa()
            {
                ZahtjevId      = IDzahtjeva,
                DatumCasa      = DatumCasaDatePicker.Value,
                VrijemePocetka = TimeSpan.Parse(TimePicker.Value.ToString("HH:mm")),
                DanNaziv       = VratiDan(DatumCasaDatePicker.Value.ToString("dddd"))
            };

            var sacuvajTermin = terminCasaService.PostResponse(termin);

            if (sacuvajTermin.IsSuccessStatusCode)
            {
                TerminForm(IDzahtjeva);
            }


            if (brojac == brojCasova)
            {
                var response = zahtjevService.GetResponse(IDzahtjeva.ToString());
                if (response.IsSuccessStatusCode)
                {
                    var zahtjev = response.Content.ReadAsAsync <Zahtjev>().Result;
                    zahtjev.Prihvaceno = true;

                    var response2 = zahtjevService.PutResponse(IDzahtjeva, zahtjev);
                    if (response2.IsSuccessStatusCode)
                    {
                        StudentKontakInfoForm kontakInfo = new StudentKontakInfoForm(zahtjev.StudentId);
                        kontakInfo.ShowDialog();
                        kontakInfo.MdiParent = this.MdiParent;
                        ZakaziBtn.Enabled    = false;
                        this.ControlBox      = true;
                    }
                }
            }
        }