Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Korisnik k = new BolnicaService.Korisnik();

                    BolnicaService.PacijentDoktor pd = new BolnicaService.PacijentDoktor();



                    try
                    {
                        k.Username          = txtUsername.Text;
                        k.Password          = txtPassword.Text;
                        k.IDKorisnickaGrupa = 3;
                        k.Ime      = txtIme.Text;
                        k.Prezime  = txtPrezime.Text;
                        k.OIB      = txtOIB.Text;
                        k.Telefon  = txtTelefon.Text;
                        k.Email    = txtEmail.Text;
                        k.Adresa   = txtAdresa.Text;
                        k.Grad     = txtGrad.Text;
                        k.PTTBroj  = txtPTTbroj.Text;
                        k.DrzavaID = Convert.ToInt32(ddlDrzava.SelectedValue);

                        pd.DoktorKorisnickiRacunID = Convert.ToInt32(hfDoktorID);


                        pd.PacijentKorisnickiRacunID = proxy.AddKorisnik(k);
                        proxy.AddPacijentDoktorVeza(pd);

                        lblStatus.Text = "Operacija uspješno spremljena";
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }